2.3   ODE No. 3

  1. Problem in Latex
  2. Mathematica input
  3. Maple input

ay(x)bsin(cx)+y(x)=0 Mathematica : cpu = 0.0497953 (sec), leaf count = 40

{{y(x)b(asin(cx)ccos(cx))a2+c2+c1eax}}

Maple : cpu = 0.211 (sec), leaf count = 37

{y(x)=eax_C1+b(sin(cx)accos(cx))a2+c2}

Hand solution

(1)dydx+ay(x)=bsin(cx)

Integrating factor μ=eadx=eax. Hence (1) becomes

ddx(μy(x))=μbsin(cx)μy(x)=bμsin(cx)dx+C

Replacing μ by eax

(2)y(x)=beaxeaxsin(cx)dx+Ceax

Using sin(cx)=eicxeicx2i then eaxsin(cx)dx=e(ic+a)xe(ic+a)x2idx=12i(e(ic+a)xic+ae(ic+a)xic+a)=12ieax(eicxic+aeicxic+a)=12ieax(eicx(ic+a)eicx(ic+a)(ic+a)(ic+a))=12ieax(iceicx+aeicxiceicxaeicx(c2+a2))=12ieax(ic(eicx+eicx)+a(eicxeicx)(c2+a2))=eax(c2+a2)(ic(eicx+eicx)2i+a(eicxeicx)2i)=eax(c2+a2)(ccoscx+asincx)

Therefore (2) becomes

y(x)=beax[eax(c2+a2)(ccoscx+asincx)]+Ceax=b(c2+a2)(ccoscx+asincx)+Ceax