Congratulations to Andrei from Tudor Vianu National College, Bucharest, Romania for this excellent solution.

(1) Plot the graph of the function y=f(x) where f(x)=sinx+|sinx|. Differentiate the function and say where the derivative is defined and where it is not defined.

I observe that sinx takes positive values between 2kπ and (2k+1)π (for integer k), that is in the first two quadrants, and sinx takes negative values between (2k+1)π and (2k+2)π, that is in the third and fourth quadrants. So
f(x) =2sinx   for2kπx(2k+1)π =0   for(2k+1)πx(2k+2)π.

Below is represented the graph of y = f(x):

f(x)=sin x + |sin x|
Now I calculate the first derivative of f(x):
f' (x) =2cosx   for2kπ<x<(2k+1)π =0   for(2k+1)π<x<(2k+2)π

The derivative f' (x) is not defined at the points x=kπ for any integer k and it does not have a tangent at these points.

(2) Now I express the function f(x)=sinx+cosx in the form f(x)=Asin(x+α), find A and α and plot the graph of this function. Similarly I express the function g(x)=sinx-cosx in the form g(x)=Bsin(x+β) where -π/2<β<π/2, and plot its graph on the same axes.


f(x) =sinx+cosx=Asin(x+α) =Asinxcosα+Acosxsinα

As this formula must be valid for any x, I obtain:
Asinα=1   andAcosα=1

and hence tanα=1, α=π/4 and A=±2.

Comment: If A has the meaning of an amplitude, A is positive, and only the positive solution must be kept. This type of problem is typical for the composition of oscillations.

Hence the graph of this function is a sine graph with a phase shift of π/4, that is f(x)=0 when x=kπ-π/4, it takes the value 1 when x=2kπ and x=2kπ+π/2 and the value -1 when x=(2k+1)π and x=2kπ-π/2, has maximum values (2kπ+π/4,2) and minimum values ((2k+1)π+π/4,-2)

In a similar manner I write g(x)=sinx-cosx:
f(x) =sinx-cosx=Bsin(x+β) =Bsinxcosβ+Bcosxsinβ

So I have
Bsinβ=-1   andBcosβ=1

and hence tanβ=-1, β=-π/4 and B=2. Hence the graph of this function is a sine graph with a phase shift of -π/4, that is f(x)=0 when x=kπ+π/4, it takes the value 1 when x=kπ and x=2kπ+π/2, has maximum values (2k+1)π-π/4,2) and minimum values (2kπ-π/4,-2).
f(x)=sin x + |cos x|
(3) Now, I calculate the function f(x)=sinx+|cosx| and plot the graph.
f(x) =sinx+cosx=2sin(x+π/4)for2kπ-π/2x2kπ+π/2 =sinx-cosx=2sin(x-π/4)for2kπ+π/2x2kπ+3π/2.

The derivative is not defined at x=kπ+π/2 and for other values of x it is:
f' (x) =cosx-sinxfor2kπ-π/2<x<2kπ+π/2 =cosx+sinxfor2kπ+π/2<x<2kπ+3π/2.