# Second Order Differential Equations

## Homework Statement

Solve the ODE with the boundary conditions given

Q''+Q = Sin(2x) where Q(0) = 1 and Q'(0) = 2
So i know i need to solve the general and particular solutions, however, I am a little confused. Any help or advice would be great, Thanks in advance.

Y = Yg +Yp

## The Attempt at a Solution

Assume RHS = 0 for general solution
Q'' + Q = 0

Let Q = e^kx
Q' = k e^kx
Q'' = k^2 e^kx
therefore
k^2e^kx + e^kx = 0
e^kx(k^2) = 0
k=0???????
Yg = A e ^kx +Bx e^kx???

Particular Solution
Yp = A Sin 2x + B Cos 2x
Yp' = 2A Cos 2x - 2B Sin 2x
Yp"= -4A Sin 2x - 4B Cos (2x)

-4A Sin 2x - 4B Cos (2x) + A Sin 2x + B Cos 2x = Sin(2x)
-3A Sin 2x = Sin 2x
a = -1/3

## The Attempt at a Solution

You've got a mistake. You made the claim that
$$k^2e^{kx}+e^{kx}=0\\ \Rightarrow k^2e^{kx}=0$$
That's not true, is it? What's ##k## really?

HallsofIvy
Homework Helper

## Homework Statement

Solve the ODE with the boundary conditions given

Q''+Q = Sin(2x) where Q(0) = 1 and Q'(0) = 2
So i know i need to solve the general and particular solutions, however, I am a little confused. Any help or advice would be great, Thanks in advance.

Y = Yg +Yp

## The Attempt at a Solution

Assume RHS = 0 for general solution
Q'' + Q = 0

Let Q = e^kx
Q' = k e^kx
Q'' = k^2 e^kx
therefore
k^2e^kx + e^kx = 0
e^kx(k^2) = 0
No, factoring out e^{kx} gives e^{kx}(k^2+ 1)= 0.

k=0???????
Yg = A e ^kx +Bx e^kx???

Particular Solution
Yp = A Sin 2x + B Cos 2x
Yp' = 2A Cos 2x - 2B Sin 2x
Yp"= -4A Sin 2x - 4B Cos (2x)

-4A Sin 2x - 4B Cos (2x) + A Sin 2x + B Cos 2x = Sin(2x)
-3A Sin 2x = Sin 2x
a = -1/3

## The Attempt at a Solution

I see. Thanks.

e^kt(k^2+1) = 0
k = i ---> sqrt(-1)

So then the general assumption would be.

Yg = e^-kt(ASin2x + iBsin2x) ?

Or just
Yg = A Sin2x + i BCos 2x
?
Sorry about lack of real looking equations I am on my iPhone

$$k=\pm i$$
So the general form of the solution is
$$Q_g(x)=c_1 e^{ix}+c_2 e^{-ix}$$
Or equivalently,
$$Q_g(x)=A\sin(x)+B\cos(x)$$
Now take a guess at the particular solution. Let's guess that ##Q_p(x)=D\sin(2x)##. Plug this into the differential equation and solve for D. It will give you the particular solution.

Excellent.
So from there:

Yp = C Sin(2x)
Yp' = 2C Cos(2x)
Yp" = -4C Sin(2x)

-4C Sin(2x) + C Sin(2x) = Sin(2x)
-3C = 1
C = -1/3

Yp = -1/3 Sin (2x)
So then the solution starts as

Y = Yg + Yp
Y = A Sin (x) + B Cos(x) -1/3 Sin(2x)

Sub in initial Conditions Q(0) = 1 or x=0
Y = A Sin (x) + B Cos(x) -1/3 Sin(2x)
1 = 0 + B - 0
B = 1

Sub in next conditions
Q'(0) = 2
Y = A Sin (x) + B Cos(x) -1/3 Sin(2x)
Y' = A Cos(x) - B Sin(x) - 2/3 Cos (2x)
Y'(0) = A - 2/3 = 2
A = 8/3

So the final solution for the equation would be

Y = 8/3 Sin(x) + Cos(x) - 1/3 Sin(2x) ?

:D

Looks good to me.