# particular solution to y'+2y=cos(10t)

From "Circuit Analysis Demystified", David McMahon, 2008, Chapter 6, page 131, Quiz question 5.

$$y' + 2y = \cos (10t)$$

Following the method from Example 6-11 in the book.

I guess that the solution has the form:

$$y = Acos(10t + \phi)$$

$$y' = -10Asin(10t + \phi)$$

substituting this into the DE:

$$-10Asin(10t + \phi) + 2Acos(10t + \phi) = \cos(10t)$$

Now I use the following trig identities to factor the DE:

\begin{aligned} \sin(x+y) &= \sin(x)\cos(y) + \cos(x)\sin(y) \\ \cos(x+y) &=\cos(x)\cos(y) - sin(x)\sin(y) \\ \tan \theta &= \frac{\sin \theta}{\cos \theta}\end{aligned}

so the DE becomes:

$$-10K\sin(10t) \cos(\phi) - 10k \cos(10t) \sin(\phi) \\+ 2k \cos(10t) \cos(\phi) - 2k \sin(10t) \sin(\phi) = \cos(10t)$$

which i factor as:

$$\cos(10t)k(-10 \sin(\phi) + \cos(\phi)) \\+ \sin(10t) k(-10 \cos(\phi) - 2 \sin(\phi)) \\= \cos(10t)$$

here I can see that LHS has a $$\sin(10t)$$ that i need to be zero in order for the LHS to equal the RHS. so that means that following needs to be zero:

$$-10 \cos(\phi) - 2 \sin(\phi) = 0$$

solving for $$\phi$$ i get:

$$\phi = tan^{-1}(-5)=-78.69^{\circ}$$

now i can plug $$\phi$$ in to equation and solve for k:

$$k = \frac{1}{10.2}$$

and that means my particular solution is:

$$y_p = \frac{1}{10.2}cos(10t - 78.69^{\circ})$$

The part i don't get is that when I solve this DE on wolfram alpha I get the particular solution of:

$$y_p = \frac{1}{52}\cos(10t) + \frac{5}{52}\sin(10t)$$

I'm wondering... why does my particular solution have only one sinusoidal term, but wolfram alpha has both a sin and cos sinusoidal term? Also, it seems that I also have a phase and they don't have a phase...

How can i solve the DE to get this form?

$$y_p = \frac{1}{52}\cos(10t) + \frac{5}{52}\sin(10t)$$

• trig identity: $A \cos(\omega t) + B \sin(\omega t) = \sqrt{A^2 + B^2} \cos\Big(\omega t - tan^{-1} (B/A)\Big)$ – pico Jan 12 at 13:05
• Why not use an Integrating Factor? Another approach is to solve homogeneous part and Undetermined Coefficients ($y_p = a \cos 10 t + b \sin 10t$), Laplace transform, Exact Equation. – Moo Jan 12 at 13:12
• Its a good suggestion... but this problem is from an Circuit analysis book where they only teach you to guess the particular solution to solve the DE...then the answer key at the back of the book gives you the solution that they secretly found using integrating factors so you have no idea if your solution is correct. – pico Jan 12 at 13:15
• I would probably use laplace... except they haven't got that far in the book yet... Is undetermined coefficents the method i'm currently using? – pico Jan 12 at 13:18
• Yes, but choose $y_p$ the way I suggested. – Moo Jan 12 at 13:18

guessing that the particular solution is:

$$y_p = A \cos(10t) + B \sin(10t)$$

$$y_p' = -10 A \sin(10t) + 10 B \cos(10t)$$

Thus:

$$y_p' + 2 y_p = \cos(10t)$$

$$(-10A \sin(10t) + 10B \cos(10t)) + 2(A \cos(10t) + B \sin(10t) = \cos(10t)$$

$$\cos(10t)(10B + 2A) + \sin(10t) (2B - 10A) = \cos(10t)$$

In order for LHS to equal RHS:

$$10B+2A = 1\tag{eq1}$$

$$2B - 10A = 0\tag{eq2}$$

solving for A and B:

$$A = \frac{1}{52}$$

$$B = \frac{5}{52}$$

Thus, the particular solution is:

$$y_p = \frac{1}{52} \cos(10t) + \frac{5}{52} \sin(10t)$$

• Your analysis of the particular solution is correct. – Axion004 Jan 12 at 14:34
• Would it be helpful if you saw a different solution to the problem through the integration factor technique (since the equation is a linear first order ode) or the Laplace transform? – Axion004 Jan 12 at 14:42
• Could be useful to somebody taking circuit analysis... they always go over DE section very quickly and not very deep..because you get that in DE class.. but if course DE class is not necessarily taken as a prerequisite to circuit analyses so you get confused – pico Jan 12 at 14:44
• ocw.mit.edu/courses/electrical-engineering-and-computer-science/… if you are curious... – pico Jan 12 at 14:58

The solution written by the OP is correct and finds the particular solution through the method of undetermined coefficients.

As the ordinary differential equation

$$\frac{dy}{dt}+2y=\cos(10t)$$

is a first order differential equation which is linear, we could also apply the integration factor technique. The general form of a first order linear equation is

$$\frac{dy}{dt}+p(t)y=g(t)$$

where both $$p(t)$$ and $$g(t)$$ are continuous functions. The integrating factor, $$\mu(t)$$, is given by

$$\mu(t)=\large{e^{\int p(t)dt}}=e^{\int 2\,dt}=e^{2t}$$

therefore if we multiply every term by the integrating factor

$$e^{2t}\frac{dy}{dt}+2e^{2t}y=e^{2t}\cos(10t)$$

and rewrite the left-hand side of the equation by the product rule

$$\frac{d}{dt}(e^{2t}y)=e^{2t}\cos(10t)$$

we find

$$e^{2t}y=\int e^{2t}\cos(10t) \,dt\tag{*}$$

where we label the integral on the right-hand side as

$$I=\int e^{2t}\cos(10t) \,dt$$

and integrate by parts twice. In the first integration by parts, $$u=\cos(10t)$$ and $$dv=e^{2t}\, dt$$. Therefore

$$I=uv -\int v \,du=\frac{1}{2}e^{2t}\cos(10t)+5\int e^{2t}\sin(10t)\,dt$$

Next, take $$u=\sin(10t)$$ and $$dv=e^{2t}\, dt$$

$$I=\frac{1}{2}e^{2t}\cos(10t)+5\left(\frac{1}{2}e^{2t}\sin(10t)-5 \int e^{2t}\cos(10t)\,dt\right)$$ $$I=\frac{1}{2}e^{2t}\cos(10t)+\frac{5}{2}e^{2t}\sin(10t)-25I$$ we solve for $$I$$ to find $$I=\frac{1}{52}e^{2t}\cos(10t)+\frac{5}{52}e^{2t}\sin(10t)+C$$ hence $$(*)$$ becomes $$e^{2t}y=\frac{1}{52}e^{2t}\cos(10t)+\frac{5}{52}e^{2t}\sin(10t)+C$$ which after dividing by $$e^{2t}$$ forms the general solution $$y(t)=\frac{1}{52}\cos(10t)+\frac{5}{52}\sin(10t)+Ce^{-2t}$$ The general solution is the same solution found by the method of undetermined coefficients. By finding the particular solution, the OP could then find the homogeneous solution and conclude $$y_g(t)=y_h(t)+y_p(t)=Ce^{-2t}+\Big(\frac{1}{52}\cos(10t)+\frac{5}{52}\sin(10t)\Big)$$