Question

Let g: R → R be a continuous function. Which one of the following is the solution of the differential equation

d2ydx2+y=g(x)forxR,

satisfying the conditions y(0) = 0, y’(0) = 1 ?

  1. y(x)=sinx0xsin(xt)g(t)dt
  2. y(x)=sinx+0xsin(xt)g(t)dt
  3. y(x)=sinx0xcos(xt)g(t)dt
  4. y(x)=sinx+0xcos(xt)g(t)dt

Answer: y(x)=sinx+0xsin(xt)g(t)dt

Solution :-

Option (1)
we have y(x)=sinx0xsin(xt)g(t)dt(1)
Differentiate eq(1) w. r. to x , we get

d(y(x))dx=d(sinx)dxddx(0xsin(xt)g(t)dt)y(x)=cosx[0x{sin(xt)g(t)}xdt+sin(xx)g(x)dxdxsin(x0)g(0)d(0)dx](using leibniz rule of two variable)y(x)=cosx[0xcos(xt)g(t)dt+sin0g(x)1sinxg(0)0]y(x)=cosx[0xcos(xt)g(t)dt+00]y(x)=cosx0xcos(xt)g(t)dt(2)

Now, again Differentiate eq(2) w. r. to x , we get

d(y(x))dx=d(cosx)dxddx(0xcos(xt)g(t)dt)y′′(x)=sinx[0x{cos(xt)g(t)}xdt+cos(xx)g(x)dxdxcos(x0)g(0)d(0)dx]y′′(x)=sinx[0x(sin(xt))g(t)dt+cos0g(x)10]y′′(x)=sinx+0xsin(xt)g(t)dt1g(x)y′′(x)=(sinx0xsin(xt)g(t)dt)g(x)y′′(x)=yg(x)y′′(x)+y=g(x)(3)

Now, we can see that differential equation of eq(3) of option (1) is not same as question’s differential equation.
Hence, option (1) is wrong.


Now, Option (2)

we have y(x)=sinx+0xsin(xt)g(t)dt(1)
Differentiate eq(1) w. r. to x , we get

d(y(x))dx=d(sinx)dx+ddx(0xsin(xt)g(t)dt)y(x)=cosx+[0x{sin(xt)g(t)}xdt+sin(xx)g(x)dxdxsin(x0)g(0)d(0)dx](using leibniz rule of two variable)y(x)=cosx+[0xcos(xt)g(t)dt+sin0g(x)1sinxg(0)0]y(x)=cosx+[0xcos(xt)g(t)dt+00]y(x)=cosx+0xcos(xt)g(t)dt(2)

Now, again Differentiate eq(2) w. r. to x , we get

d(y(x))dx=d(cosx)dx+ddx(0xcos(xt)g(t)dt)y′′(x)=sinx+[0x{cos(xt)g(t)}xdt+cos(xx)g(x)dxdxcos(x0)g(0)d(0)dx]y′′(x)=sinx+[0x(sin(xt))g(t)dt+cos0g(x)10]y′′(x)=sinx0xsin(xt)g(t)dt+1g(x)y′′(x)=(sinx+0xsin(xt)g(t)dt)+g(x)y′′(x)=y+g(x)y′′(x)+y=g(x)(3)

Now, we can see that differential equation of eq(3) of option (2) is same as question’s differential equation.
Hence, option (2) is correct.


Now, Option (3)

we have y(x)=sinx0xcos(xt)g(t)dt(1)
Differentiate eq(1) w. r. to x , we get

d(y(x))dx=d(sinx)dxddx(0xcos(xt)g(t)dt)y(x)=cosx[0x{cos(xt)g(t)}xdt+cos(xx)g(x)dxdxcos(x0)g(0)d(0)dx](using leibniz rule of two variable)y(x)=cosx[0x(sin(xt))g(t)dt+cos0g(x)1cosxg(0)0]y(x)=cosx[0x(sin(xt))g(t)dt+g(x)0]y(x)=cosx+0xsin(xt)g(t)dtg(x)(2)

Now, again Differentiate eq(2) w. r. to x , we get

d(y(x))dx=d(cosx)dx+ddx(0xsin(xt)g(t)dt)d(g(x))dxy′′(x)=sinx+[0x{sin(xt)g(t)}xdt+sin(xx)g(x)dxdxsin(x0)g(0)d(0)dx]g(x)y′′(x)=sinx+[0xcos(xt)g(t)dt+sin0g(x)10]g(x)y′′(x)=sinx+0xcos(xt)g(t)dt+0g(x)g(x)y′′(x)=(sinx0xcos(xt)g(t)dt)g(x)y′′(x)=yg(x)y′′(x)+y=g(x)(3)

Now, we can see that differential equation of eq(3) of option (3) is not same as question’s differential equation.
Hence, option (3) is also wrong.


Now, Option (4)

we have y(x)=sinx+0xcos(xt)g(t)dt(1)
Differentiate eq(1) w. r. to x , we get

d(y(x))dx=d(sinx)dx+ddx(0xcos(xt)g(t)dt)y(x)=cosx+[0x{cos(xt)g(t)}xdt+cos(xx)g(x)dxdxcos(x0)g(0)d(0)dx](using leibniz rule of two variable)y(x)=cosx+[0x(sin(xt))g(t)dt+cos0g(x)1cosxg(0)0]y(x)=cosx+[0x(sin(xt))g(t)dt+g(x)0]y(x)=cosx0xsin(xt)g(t)dt+g(x)(2)

Now, again Differentiate eq(2) w. r. to x , we get

d(y(x))dx=d(cosx)dxddx(0xsin(xt)g(t)dt)+d(g(x))dxy′′(x)=sinx[0x{sin(xt)g(t)}xdt+sin(xx)g(x)dxdxsin(x0)g(0)d(0)dx]+g(x)y′′(x)=sinx[0xcos(xt)g(t)dt+sin0g(x)10]+g(x)y′′(x)=sinx0xcos(xt)g(t)dt0g(x)+g(x)y′′(x)=(sinx+0xcos(xt)g(t)dt)+g(x)y′′(x)=y+g(x)y′′(x)+y=g(x)(3)

Now, we can see that differential equation of eq(3) of option (4) is not same as question’s differential equation.
Hence, option (4) is also wrong.


So, correct answer is option-2, y(x)=sinx+0xsin(xt)g(t)dt