First order Differential equation problem

Thread Starter


Joined Feb 25, 2010
Hello All,
I am learning Signals and Systems by watching videos on-line and using the Alan V Oppenheim book. The current video I am watching has a portion missing out of it, the professor starts a problem of but the working out is missing. On the next video the solution is presented however I am unable to fill in the missing blanks . The video is here
He starts the question about 30 minutes into the video.
I will write the question out and show my working out. If some one could show me where I have gone I will really appreciate it.

The question is to solve the following FODE.

y' + 2y= Kcos wt (u(t)) where y is the first derivative.

Solve using particular integral + the complementary solution.
The input can be expressed in the exponential form: Re[K* e^jwt]

PI= Assume solution for y that is similar to the input: Re[Y*e^jwt], substituting this in for y is

jwYe^jwt + 2Ye^jwt=Ke^jwt dividing by e^jwt.

jwY+2Y=K which makes Y = K/(jw+2) the absolute magnitude of |y| is: k/√(2+w^2) and ∅= -tan w/2.

A complex number can be written as |A| e^j∅ here A is |Y|e^jwt. is that is done the result is:

|Y|e^jwte^j∅ = |Y|e^j(wt+∅) [ in the video the prof has written Ye^j(wt-∅) which doesn't matter in this case as we know the input is real and even.

Returning the cosine, the PI = |Y| cos wt+cos∅.
The complementary function to the input assuming the input is 0 and y= Ae^mt.

substituting this in and working out m as -2 we have y= Ae^-2t.

I kind of got stuck after this, the solution is:

y(t)= Ye^-2t + k/(√4+w^2)[ cos(wt-∅) - cos ∅e-2t] u(t).

Where did the cos ∅e^2t come from?

I a have not been on this forum for a long time and dont know where the latex code option is so I apologise in advance for not using it.


Joined Jun 17, 2014

Quick question...

In the line you wrote:
"y' + 2y= Kcos wt (u(t)) where y is the first derivative."

did you mean that y' is the first derivative of y ?
In problems like this y is usually the function and y' is its derivative.

Your solution doesnt look right, but then again your typing form should be improved to show the correct forms, so you might want to use a few more sets of parenthesis to help.
Last edited:

Jack OwwO

Joined Jun 18, 2015
The development is in the Oppenheim, so if you have it just go read it. :s
If not, the development you've done was on t >0 to get rid of u(t), and you've obtained:
\( y = A e^{-2t} + \frac{K \cos \theta }{\sqrt{4+{\omega_0}^{2}}}[\cos{{\omega_0}t -\theta}] \), t>0

you set y(0) = \(y_0\) isolate A and get (domain problem:p):

\( A = y_0 - \frac{K \cos \theta }{\sqrt{4+{\omega_0}^{2}}} \)

You replace and get :
\( y = y_0 e^{-2t} + \frac{K \cos \theta }{\sqrt{4+{\omega_0}^{2}}}[\cos{{\omega_0}t -\theta} - e^{-2t} cos \theta]\), t>0

Then, he show for all t :
\( y = y_0 e^{-2t} + \frac{K \cos \theta }{\sqrt{4+{\omega_0}^{2}}}[\cos{{\omega_0}t -\theta} - e^{-2t} cos \theta]u(t)\)

Thread Starter


Joined Feb 25, 2010
Sorry for the delay in responding, please dont think I am not greatfull for your help.

I have had a bash at using the latex code using the helpfull links posted, thank you.

I have a solution which is close to what it should be but not exact, also I am stuck on the phase shift as my calculations show that it knocks out the cosine alltogether, clearly I have made a mistake but I dont know where. I am not from a mathematical background at all so tehre may be obvious errors in my calculations.

\( y'(t) + 2y(t) = x(t) \ \ where \ \ x(t) = (K cos \omega t)( u(t))\)

\( Assume \ x(t) = Re[Ke^ j ^\omega^ t] \ \ For \ the\ moment\ treat\ x(t) = Ke^ j ^\omega^ t \)

Solution is equal to particular solution + complementry solution \( Y = Y(p) + Y(c) \)

\( Assume \ a \ soution \ for \ Y(p) = Ye^ j ^\omega^ t \)

Particular solution is:

\( j \omega Y e^j^\omega^t\ + 2Y e^j^\omega^t\ = Ke^ j ^\omega^ t \ \ \ Divide \ by \ e^ j ^\omega^ t \)

\( j \omega Y + 2Y = K \ \ \ therefore:\ \ Y = \frac{K}{j\omega+2} \)
The modulus of Y is \( |Y| = \frac{K}{\sqrt{4+\omega^2}} \)

The phase response is determined by the phase shift of the numerator subtract the phase shift of the denominator.

\( Y = \frac{K}{j\omega+2} \)

I am using the \( tan \theta \) The numerator is 100% real, denominator is real and imaginary therefore

\( tan^-^1 \ (\frac{0}{K}) \ - \ tan^-^1 \ (\frac{\omega}{2})\)

The result should be: \( \theta = - \ tan^-^1 \ (\frac{\omega}{2})\)

The result is: \( \theta = \ tan^-^1 \ (\frac{\omega}{2})\)

I am not sure how this became positive in the solution, it may be because the original is causal which means there is no signal when t<0.
Is this correct?, I know phase is an odd function therefore it would make it positive.

Back to the Y(p), we have \( |Y| = \frac{K}{\sqrt{4+\omega^2}} e^j^\omega^t \)

Note that \( e^j^\omega^t \) is 100% real, a complex number can be written as magnitude and phase
\( |Y| = |\frac{K}{\sqrt{4+\omega^2}} e^j^\omega^t| e^-^j^\theta \)

There are no imaginary parts to this complex number therefore: \( \frac{K}{\sqrt{4+\omega^2}} (e^\omega^t ^- ^\theta) \)
\( Y(p)=\frac{K}{\sqrt{4+\omega^2}} (cos (\omega t - \theta)) \)

The complementary solution is \( Y(c)= Ae^-^2^t\)

Solution so far is:

\( Y(t)= Ae^-^2^t \ +\ \frac{K}{\sqrt{4+\omega^2}} (cos (\omega t - \theta)) \)

\( Y(0)= A \ +\ \frac{K}{\sqrt{4+\omega^2}} (cos (\omega (0) - tan^-^1(\frac{\omega}{2})) \)

if I make \( \omega = 2000 \pi \)

\( Y(0)= A \ +\ \frac{K}{\sqrt{4+\omega^2}} (cos ( (0) - (\frac{\pi}{2})) \)

I make this result

\( Y(0)= A \ +\ \frac{K}{\sqrt{4+\omega^2}} (0) \)

\( Y(0)= A \ \)

This is a mistake but I dont understand where I have gone wrong, could you please offer some help/advice here.

If I continue assuming the correct result at this point:

\( Y(0)= A \ +\ \frac{K}{\sqrt{4+\omega^2}} \)

\( A= Y(0) \ -\ \frac{K}{\sqrt{4+\omega^2}} \)

\( Y(t)=(Y(0) \ -\ \frac{K}{\sqrt{4+\omega^2}}) e^-^2^t \ +\ \frac{K}{\sqrt{4+\omega^2}} (cos (\omega t - \theta)) \)

\( Y(t)=Y(0) \ e^-^2^t -\ \frac{K}{\sqrt{4+\omega^2}}e^-^2^t \ +\ \frac{K}{\sqrt{4+\omega^2}} (cos (\omega t - \theta)) \)

The second term can be written as a real part and imaginary part

\( Y(t)=Y(0) \ e^-^2^t -\ \frac{K}{\sqrt{4+\omega^2}}e^-^2^t e^-^j^\theta \ +\ \frac{K}{\sqrt{4+\omega^2}} (cos (\omega t - \theta)) \)

\( Y(t)=Y(0) \ e^-^2^t -\ \frac{K}{\sqrt{4+\omega^2}}e^-^2^t -cos\theta \ +\ \frac{K}{\sqrt{4+\omega^2}} (cos (\omega t - \theta)) \)

\( Y(t)=Y(0) \ e^-^2^t -\ \frac{K}{\sqrt{4+\omega^2}} (cos (\omega t - \theta)- cos\theta\ e^-^2^t ) (u(t))\)

Solution according to video is:
\( Y(t)=Y(0) \ e^-^2^t +\ \frac{K}{\sqrt{4+\omega^2}} (cos (\omega t - \theta)- cos\theta\ e^-^2^t ) (u(t)) \)


Joined Mar 31, 2012
I haven't waded through all the math (but mucho thanks for providing it, it will come in handy).

It appears the only different in the two answers is the sign of the second term.

First I would take both answers and see if they are, in fact, solutions to the original differential equation. It's always possible they made a mistake.

If yours is a solution and theirs is not, then verify that you are both actually starting from the same differential equation and initial conditions.

If yours is wrong, track back through your work and find where your sign came from and look at the work in that area very closely. Your detailed steps above will be very helpful in that process.

Thread Starter


Joined Feb 25, 2010
WBahn, No problem, good people like you take your time for free to help people like me out. The very least I can do is present the question in the preferred way.

I will check my own solutions, Jack gets the solution that was determined in the video, I just could not figure out how he did it.

My 2 issues are:

Issue 1)

I make the phase shift = \( \theta=\frac{\pi}{2}\)

This makes = \( y(0)= A \)

Issue 2)

That minus sign after the first term.

Thread Starter


Joined Feb 25, 2010
I think I have spotted my 2 mistakes, 1 was a simple maths mistake the othe is a bit more subtle.

Mistake 1) Simplification error in factoring out a term.

\( Y(t)=Y(0) \ e^-^2^t -\ \frac{K}{\sqrt{4+\omega^2}}e^-^2^t -cos\theta \ +\ \frac{K}{\sqrt{4+\omega^2}} (cos (\omega t - \theta)) \)

This simplifies to:

\( Y(t)=Y(0) \ e^-^2^t +\ \frac{K}{\sqrt{4+\omega^2}} ( (cos (\omega t - \theta) -cos\theta \ e^-^2^t) \)

Mistake 2) Has to do with the fact that the input is bieng multiplied the unit impulse function meaning that the amplitude is 0 when t<0.

when t = 0, then \( ( cos (\omega t - \theta)) = ( cos (0 - \theta)) \) It does not matter what \( \theta \) is the value will still be 1 which would satisfy the solution.

Is this correct?