# y" +4y=4cos(2x) , y(0)=0 ; y'(0)=0

#### anetajakimova

##### New member

I solved till there,and than? Can someone help me?
Thank you.

#### Subhotosh Khan

##### Super Moderator
Staff member
View attachment 12399View attachment 12400View attachment 12401
I solved till there,and than? Can someone help me?
Thank you.
Since your "forcing function" is also "homogeneous solution", you have a "resonance effect".

The total solution should be:

y = A*cos(2x) + B*sin(2x) + x * [cos(2x) + sin(2x)]

Check that above function satisfies the given DE.

Now using initial conditions, solve for A and B.

#### MarkFL

##### Super Moderator
Staff member
Hello, and welcome to FMH!

I agree the the homogeneous solution is:

$$\displaystyle y_h=c_1\cos(2x)+c_2\sin(2x)$$

And so this means our particular solution will take the form:

$$\displaystyle y_p(x)=x(A\sin(2x)+B\cos*(2x))$$

And so using the method of undetermined coefficients, we get:

$$\displaystyle 4(A-Bx)\cos(2x)-4(Ax+B)\sin(2x)+4(x(A\sin(2x)+B\cos(2x)))=4\cos(2x)$$

$$\displaystyle A\cos(2x)-B\sin(2x)=1\cdot\cos(2x)+0\cdot\sin(2x)$$

Hence:

$$\displaystyle (A,B)=(1,0)$$

And so:

$$\displaystyle y_p(x)=x\sin(2x)$$

And thus, the general solution is:

$$\displaystyle y(x)=y_h(x)+y_p(x)=c_1\cos(2x)+c_2\sin(2x)+x\sin(2x)$$

Now, you may proceed to determine the values of the two parameters which satisfy the IVP.

#### anetajakimova

##### New member
Hi
I understand everything but i have just problems with derivating.
Can you explain me in details please,because i make mistake in yp when it needs to be derivated and then when you need to put it in the given equation : yp" +4yp=4cos(2x)
Thank you

#### MarkFL

##### Super Moderator
Staff member
Your posted work is too small for me to comfortably read...can you post your work where I can easily read it?

#### anetajakimova

##### New member
Okay no problem,where ?

#### MarkFL

##### Super Moderator
Staff member
Preferably here in this thread.

#### anetajakimova

##### New member
Okay,is it okay like this?

#### Attachments

• 30.4 KB Views: 2
• 37.4 KB Views: 2
• 23.5 KB Views: 0

#### MarkFL

##### Super Moderator
Staff member
Aren't those exactly the same small hard to read images you initially posted?

#### anetajakimova

##### New member

Mistake, this is what i wanted to send.

#### MarkFL

##### Super Moderator
Staff member
Unfortunately, 2 of the images are sideways, and the third is upside down. Please just type out your attempt to differentiate the particular solution so I can easily read it, and try to see where you may have gone wrong.

#### anetajakimova

##### New member
Okay.
I make mistake when i need to derivate this part:
yp=x (A*cos(2x) +B*sin(2x) )
i dont know how to make first and second derivative.

#### MarkFL

##### Super Moderator
Staff member
Okay.
I make mistake when i need to derivate this part:
yp=x (A*cos(2x) +B*sin(2x) )
i dont know how to make first and second derivative.
Can you post your work, using $$\LaTeX$$ or even plain text so I can see where you're going wrong?

#### HallsofIvy

##### Elite Member
Okay.
I make mistake when i need to derivate this part:
yp=x (A*cos(2x) +B*sin(2x) )
i dont know how to make first and second derivative.
I am puzzled by this. You are trying to do differential equations but do not know how to differentiate?

Hopefully you know that the derivative of cos(x) is -sin(x) and the derivative of sin(x) is cos(x) and, using the "chain rule" the derivative of cos(2x) is -sin(2x) times the derivative of 2x so -2sin(2x) and, similarly, the derivative of sin(2x) is 2cos(2x). By the product rule, the derivative of x(A cos(2x)+ B sin(2x)) is (the derivative of x) times (A cos(2x)+ B sin(2x)) plus x times the derivative of A cos(2x)+ B sin(2x). That is, the derivative of x(A cos(2x)+ B sin(2x)) is (A cos(2x)+ B sin(2x)+ x(-2A sin(2x)+ 2B cos(2x)).