Hey guys!

I've recently encountered this problem and I would like to know if any of you could present a more elegant or simple solution to it.

My solution:

When

So for we have:

We sketch the graph, find solutions and then see what happens if