# Solving a differential equation for a cyclic model?

I am trying to figure out how to solve this differential equation for the initial condition, but I am completely lost and the book doesn't cover anything like this in the same section. So can anyone provide some assistance?

$\alpha=\beta=1, k=2$, and $x_0=10$, solve for $x(t)$

$\frac{dx}{dt}=\alpha-\beta cos(\frac{\pi t}{12})-kx$, and $x(0)=x_0$

• It's a first order non-homogeneous linear equation. The common method to solve it is variation of parameters (Lagrange method). – Evgeny Apr 20 '16 at 21:21
• Thanks, I realized this shortly after I posted but am no longer at my computer. For completeness I will post my solution later today. Hopefully it will be a useful example to others that struggle with this method. – JDOdle Apr 20 '16 at 21:29
• Oh I figured the Lagrange method was the same thing as Integrating factor – JDOdle Apr 21 '16 at 2:26

I think I figured it out... Using an integration factor. This is one beastly problem!

1. $\frac{dx}{dt}=1-cos(\frac{\pi t}{12})-2x=0$
2. $dx=(1-cos(\frac{\pi t}{12})-2x)dt$
3. $(cos(\frac{\pi t}{12})-1+2x)dt+dx=0$
4. $(cos(\frac{\pi t}{12})e^{2t}-e^{2t}+2xe^{2t})dt+e^{2t}dx\ \ \$ -$\ \ \$now in the form of an exact equation
5. $\int cos(\frac{\pi t}{12})e^{2t}dt-\frac{1}{2}e^{2t}+xe^{2t}$

$a.\ solve\ for:\ \ \int cos(\frac{\pi t}{12})e^{2t}dt$

$\ \ \ \ \ \ \ \ \ \ \ \ i.\ \ \ u=cos(\frac{\pi t}{12})\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ v=\frac{1}{2}e^{2t}$

$\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ du=-\frac{\pi}{12}sin(\frac{\pi t}{12})dt\ \ \ \ \ \ \ \ dv=e^{2t}$

$\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =\frac{1}{2}cos(\frac{\pi t}{12})e^{2t}+\frac{1}{2}\frac{\pi}{12}\int sin(\frac{\pi t}{12})e^{2t}dt-\frac{1}{2}e^{2t}$

$\ \ \ \ \ \ \ \ \ \ \ ii.\ \ \ u=sin(\frac{\pi t}{12})\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ v=\frac{1}{2}e^{2t}$

$\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ du=\frac{\pi}{12}cos(\frac{\pi t}{12})dt\ \ \ \ \ \ \ \ \ \ \ dv=e^{2t}$

$\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =\frac{1}{2}cos(\frac{\pi t}{12})e^{2t}+\frac{1}{2}\frac{\pi}{12}(\frac{1}{2}sin(\frac{\pi t}{12})e^{2t}-\frac{1}{2}\frac{\pi}{12}\int cos(\frac{\pi t}{12})e^{2t})$

$\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ =\frac{1}{2}cos(\frac{\pi t}{12})e^{2t}+\frac{1}{4}\frac{\pi}{12}sin(\frac{\pi t}{12})e^{2t}-\frac{1}{4}\frac{\pi}{12}^2\int cos(\frac{\pi t}{12})e^{2t}$

$\ \ \ \ \ \ \ \ \ \ iii. \ \ \ (1+\frac{1}{4}\frac{\pi}{12}^2)\int cos(\frac{\pi t}{12})e^{2t}=\frac{1}{2}cos(\frac{\pi t}{12})e^{2t}+\frac{1}{4}\frac{\pi}{12}sin(\frac{\pi t}{12})e^{2t}$

$$\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \int cos(\frac{\pi t}{12})e^{2t}=\frac{2cos(\frac{\pi t}{12})e^{2t}}{4+(\pi/12)^2}+\frac{(\pi/12)sin(\frac{\pi t}{12})e^{2t}}{4+(\pi/12)^2}+C$$

1. $\frac{2cos(\frac{\pi t}{12})e^{2t}}{4+(\pi/12)^2}+\frac{(\pi/12)sin(\frac{\pi t}{12})e^{2t}}{4+(\pi/12)^2}-\frac{1}{2}e^{2t}+xe^{2t}+C+g(x)=0$

2. $\frac{d}{dx}(\frac{2cos(\frac{\pi t}{12})e^{2t}}{4+(\pi/12)^2}+\frac{(\pi/12)sin(\frac{\pi t}{12})e^{2t}}{4+(\pi/12)^2}-\frac{1}{2}e^{2t}+xe^{2t}+C)+g'(x)=e^{2t}$

3. $e^{2t}+g'(x)=e^{2t}$

4. $g'(x)=0$ $$x(t)=\frac{1}{2}-\frac{2cos(\frac{\pi t}{12})}{4+(\pi/12)^2}-\frac{(\pi/12)sin(\frac{\pi t}{12})}{4+(\pi/12)^2}+Ce^{-2t}$$
5. $x(0)=10=\frac{1}{2}-\frac{2cos(\frac{\pi*0}{12})}{4+(\pi/12)^2}-\frac{(\pi/12)sin(\frac{\pi*0}{12})}{4+(\pi/12)^2}+Ce^{-2*0}$
6. $10=\frac{1}{2}-\frac{2cos(0)}{4+(\pi/12)^2}-\frac{(\pi/12)sin(0)}{4+(\pi/12)^2}+C$
7. $C=\frac{19}{2}+\frac{2}{4+(\pi/12)^2}$

$$\frac{1}{2}-\frac{2cos(\frac{\pi t}{12})}{4+(\pi/12)^2}-\frac{(\pi/12)sin(\frac{\pi t}{12})}{4+(\pi/12)^2}+(\frac{19}{2}+\frac{2}{4+(\pi/12)^2})e^{-2t}$$