Check the attachment.
Lemme know if u need an explanation.
If you ever need to graph a function, you could use desmos. Some teachers allow it. :)