# Nonhomogenous Second Order Ordinary Differential Equation issues.

I had some trouble on an exam recently with the particular solution of a Nonhomogeneous Second Order Ordinary Differential Equation.

So, the problem was: \begin{cases} y''+4y=\sec(2t) \\ y(0)=y'(0)=0 \\ \end{cases}

Solve the Initial Value Problem, and identify the domain of definition of the solution function.

I was able to solve for the homogeneous solution of $Y_H=c_1\sin(2t) + c_2\cos(2t)$ but I had some serious trouble with getting the particular solution.

The hint said to use either Variation of Parameters or the Green Function method. I was not able to do either of these to completion in the time allotted, and I would appreciate someone helping explain a bit about how to apply those to this equation.

EDIT: Someone below has explained how to apply Variation of Parameters to this pretty well. Can someone help explain Greens Function method to me?

Use variation of parameter $Yp=u_1(t)\sin{(2t)}+u_2(t)\cos{(2t)}$, you should set two equations:

$$u_1'(t)\sin{(2t)}+u_2'(t)\cos{(2t)}=0\\2u_1'(t)\cos{(2t)}-2u_2'(t)\sin{(2t)}=\sec{(2t)}$$

Can you continue from here to solve for $u_1,u_2$? For example, you can use Cramer's rule, or you can use general substitution method.

Cramer's rule says that, the answer to a $2\times 2$ linear system of equation

$$a x_1+bx_2=r_1\\ cx_1+dx_2=r_2$$

is given by

$$x_1=\frac{\det{\begin{pmatrix}r_1&b\\r_2&d\end{pmatrix}}}{\det{\begin{pmatrix}a&b\\c&d\end{pmatrix}}}, x_2=\frac{\det{\begin{pmatrix}a&r_1\\c&r_2\end{pmatrix}}}{\det{\begin{pmatrix}a&b\\c&d\end{pmatrix}}}$$

as long as the coefficient matrix is nonsingular. You can see, the denomenators are just the determinant of the coefficient matrix. The numerator is obtained by replacing the corresponding column by the right hand side. This can be generalized to $n\times n$ case.

Green's function method is very similar:

The Green's function for this problem is

$$G(t,t')=C_1(t')\sin{(2t)}+C_2(t')\cos{(2t)}, t>t'$$

The Green's function is assumed to be $0$ when $t<t'$ because of the initial condition $y(0)=y'(0)=0$.

To satisfy the continuity and discontinuity condition for $G$ and $dG/dt$ at $t=t'$, we have

$$C_1(t')\sin{(2t')}+C_2(t')\cos{(2t')}=0\\2C_1(t')\cos{(2t')}-2C_2(t')\sin{(2t')}=1$$

The $1$ on the right hand side comes from $1/p(t)$ where $p(t)$ is the coefficient of the second derivative term in the original equation. In our case this is $1$.

You can then solve for $C_1(t')$ and $C_2(t')$ to get $G(t,t')$.

Finally the particular solution is given by

$$y_p(t)=\int^t_0 G(t,t')f(t')dt'$$

• I dont think I've ever been taught Cramer's Rule. I'm going to look that up and get back to you. [looked up] Ok, yeah, I havent really touched on much linear algebra. Right now im just doing Diff Eq and havent done Linear before. I think I've used a simple case of this before, so yeah, that makes sense. – Asimov Apr 4 '15 at 19:17
• You can use substitution then. For example, from first equation, $u_2'(t)=-\tan{(2t)}u_1'(t)$. Plug this into the second can help you solve for $u_1'(t)$. – KittyL Apr 4 '15 at 19:18
• Ok, yeah that makes sense, and at this stage would probably be simpler for me, seeing as I have little to no experience in Linear Algebra. Thanks – Asimov Apr 4 '15 at 19:19
• OK, just added the Cramer's rule for future reference. – KittyL Apr 4 '15 at 19:25
• Thanks a bunch. I hate to seem a bother, but do you think you could also lightly explain how Greens Function could be applied here? I mean, they both solve the problem, but I figure its smarter to understand both instead of just one. – Asimov Apr 4 '15 at 19:29