# Thread: Second Order Nonhomogeneous Equation

1. ## Second Order Nonhomogeneous Equation

Hey everyone, I need help understanding solving this equation as it deals with an input function that is discontinuous, which I don't know how to handle.

$g(x) =sin x$ for $0 \le x \le \frac{\pi}{2}$
$g(x)=0$ for $x > \frac{\pi}{2}$
Solve $y''+4y=g(x)$

The two intervals:
$y'' +4y = sin (x)$ for $0 \le x \le \frac{\pi}{2}$

and

$y'' +4y = 0$ for $x > \frac{\pi}{2}$

with $y(0)= 1$ and $y'(0)=2$

Can anyone help me?

Thanks

2. Solve the homogeneous equation .

It has characteristic equation , which has solution .

From this, we can determine that the solution to the homogeneous DE is . This is also the entire solution when .

Now for the nonhomogeneous solution, i.e. when , we try . This would mean and .

Substituting into the DE gives

.

So the particular solution is .

Therefore when , the solution of the DE is .

Now you will need to use your boundary conditions to evaluate A and B.

3. Originally Posted by Prove It
Solve the homogeneous equation .

It has characteristic equation , which has solution .

From this, we can determine that the solution to the homogeneous DE is . This is also the entire solution when .
May I ask how do you know this is the entire solution when you dont know A and B at this stage?

4. Because g(x) = 0 when x > pi/2, which means the DE is homogeneous in that domain.

5. Originally Posted by Nguyen
Hey everyone, I need help understanding solving this equation as it deals with an input function that is discontinuous, which I don't know how to handle.

$g(x) =sin x$ for $0 \le x \le \frac{\pi}{2}$
$g(x)=0$ for $x > \frac{\pi}{2}$
Solve $y''+4y=g(x)$

The two intervals:
$y'' +4y = sin (x)$ for $0 \le x \le \frac{\pi}{2}$

and

$y'' +4y = 0$ for $x > \frac{\pi}{2}$

with $y(0)= 1$ and $y'(0)=2$

Can anyone help me?

Thanks
Since this is an IVP an alternative is to use the Laplace transform to solve note that

$\sin(x)=\cos\left( x-\frac{\pi}{2}\right)$

So the right hand side can be written as

$g(x)=\sin(x)-u\left(x-\frac{\pi}{2} \right)\cos\left( x-\frac{\pi}{2}\right)$

and this has Laplace transform

$G(s)=\frac{1}{s^2+1}-e^{-\frac{\pi}{2}s}\cdot \frac{s}{s^2+1}$

6. Thanks Prove It and TheEmptySet, I did the question the same way as Prove It but crossed it out becuase I didn't know how to deal with g(x) being discontinuous.

I got y= 5/6 sin(2x) +cos(2x)+1/3 sin(x)

7. Originally Posted by Nguyen
Thanks Prove It and TheEmptySet, I did the question the same way as Prove It but crossed it out becuase I didn't know how to deal with g(x) being discontinuous.

I got y= 5/6 sin(2x) +cos(2x)+1/3 sin(x)
Prove It's method was simply telling you to do the problem over two domains. Not that complicated! I'd recommend learning to do it that way. It's good practice.

-Dan