[tex]\dfrac{\mathrm dy}{\mathrm dx}=\cos(x+y)[/tex]
Let [tex]v=x+y[/tex], so that [tex]\dfrac{\mathrm dv}{\mathrm dx}-1=\dfrac{\mathrm dy}{\mathrm dx}[/tex]:
[tex]\dfrac{\mathrm dv}{\mathrm dx}=\cos v+1[/tex]
Now the ODE is separable, and we have
[tex]\dfrac{\mathrm dv}{1+\cos v}=\mathrm dx[/tex]
Integrating both sides gives
[tex]\displaystyle\int\frac{\mathrm dv}{1+\cos v}=\int\mathrm dx[/tex]
For the integral on the left, rewrite the integrand as
[tex]\dfrac1{1+\cos v}\cdot\dfrac{1-\cos v}{1-\cos v}=\dfrac{1-\cos v}{1-\cos^2v}=\csc^2v-\csc v\cot v[/tex]
Then
[tex]\displaystyle\int\frac{\mathrm dv}{1+\cos v}=-\cot v+\csc v+C[/tex]
and so
[tex]\csc v-\cot v=x+C[/tex]
[tex]\csc(x+y)-\cot(x+y)=x+C[/tex]
Given that [tex]y(0)=\dfrac\pi2[/tex], we find
[tex]\csc\left(0+\dfrac\pi2\right)-\cot\left(0+\dfrac\pi2\right)=0+C\implies C=1[/tex]
so that the particular solution to this IVP is
[tex]\csc(x+y)-\cot(x+y)=x+1[/tex]