How to solve the ODE y'' + y = sin(x)

  • Thread starter Thread starter toastie
  • Start date Start date
  • Tags Tags
    Ode
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 4K views
toastie
Messages
46
Reaction score
0

Homework Statement


y"+y=sinx

initial conditions: y(90 deg) = 3, y(45 deg) = 2

Calculate y at x = -1


Homework Equations


y=u+v


The Attempt at a Solution



I have gotten the following:

r^2 + 1 = 0 Therefore, r1=i and r2 = -i

u=(c1)cosx + (c2)sinx

v=Asinx + Bcosx
v'=Acosx - Bsinx
v"=-Asinx - Bcosx

-Asinx -Bcosx + Asinx + Bcosx - sinx = 0

everything cancels down to: -sinx = 0. Thus, v=0

Then I get,

y=(c1)cosx + (c2)sinx + 0

y(45 deg) shows that c2=2

y(90 deg) shows that c1=3

Thus, y=3cosx + 2sinx

y(-1) = -.06204

Could someone please let me know where I am making a mistake?

Thank you in advance!
 
Physics news on Phys.org


The solution of the homogeneous case has terms cos x and sin x in it. The right-hand-side *also* has one of those terms in it. Presumably your textbook has the information of what to do in this exceptional case... as you found, the usual method does not work.