# Given $y = A\cos2x + B\sin2x$; find the value of $A$ and $B$ if $y = 3$ when $x = \frac{\pi}{2}$ and $\frac{dy}{dx} = 4$ when $x = 0$

There is an additional part to this question where it asks to show that $$\frac{d^2y}{dx^2} + 4y =0$$. I was able to solve that part but I got stuck where I had to find the values of A and B. In the textbook it says that the values are (-3,2) but I am unable to solve for the answer.

Work: \begin{align} \frac{dy}{dx} &= -2A \sin2x + 2B \cos2x \\ 4 &= -2A \sin(0) + 2B \cos(0) \\ 4 &= 2B \\ B &= 2, \end{align}

If $$y = 3$$, when $$x= \frac{\pi}{2}$$, then $$3 = A \cos\pi + B \sin\pi$$.

• Welcome to MSE. It will be more likely that you will get an answer if you show us that you made an effort. This should be added to the question rather than in the comments. – José Carlos Santos Sep 21 '18 at 6:02
• Hem, what is $\sin \pi$ ? – Yves Daoust Sep 21 '18 at 7:48
• @YvesDaoust I’m sorry, I don’t understand what you mean by that. – Hyacinx Sep 21 '18 at 8:02
• @Sinoka: can't you answer ?? – Yves Daoust Sep 21 '18 at 8:08
• @YvesDaoust Ah, I see! I can’t believe I couldn’t answer that. Thanks a lot. – Hyacinx Sep 21 '18 at 8:18

Let $$y(x)= A \cos 2x+B \sin 2x$$. Then $$3=y( \pi /2)=-A$$.
We have $$y'(x)= -2A \sin 2x+2B \cos 2x$$, hence $$4=y'(0)=2B$$.