# Second order differential equation solution error

Assume a second order system is described by: $$a_0 \frac{d^2x(t)}{dt^2} + a_1 \frac{dx(t)}{dt} + a_2x(t) = b_0u(t)$$ where $a_i$ and $b_i$ are real constants, and $x(t)$ and $u(t)$ are real functions. Assuming that the roots of the homogeneous are a pair of conjugate complex numbers: $$\lambda_{1,2} = -\alpha \pm j\beta$$ where $\alpha$ is a positive real number and $\beta$ is a real positive number, then we have: $$x_h(t) = e^{-\alpha t} [C_1 cos(\beta t) + C_2 sin(\beta t)]$$ Next let's assume that the function $u(t)$ is of the form: $$u(t) = kh(t)$$ where $k$ is a positive real number, and h(t) is the Heaviside step function with amplitude one. For $x(0) = 0$ and $x'(0) = 0$ we have the particular solution: $$x_p(t) = K$$ $$x(t) = x_h(t) + x_p(t) = K + e^{-\alpha t} [-K cos(\beta t) -K \frac{\alpha}{\beta} sin(\beta t)]$$ For: $$C_1 cos(\beta t) + C_2 sin(\beta t) = R sin(\beta t + \varphi)$$ we have: $$\frac{C_1}{C_2} = tg(\varphi) \Rightarrow \varphi = arctg(\frac{C_1}{C_2})$$ and from the previous values for $C_1$ and $C_2$ we have: $$R = K \sqrt{1 + (\frac{\alpha}{\beta})^2}$$ so finally(for $t \geq 0 )$: $$x(t) = K\left( 1 + e^{-\alpha t}\sqrt{1 + (\frac{\alpha}{\beta})^2}sin(\beta t + \varphi) \right)$$ when it should be (at least that's what it says in my book): $$x(t) = K\left( 1 - e^{-\alpha t}\sqrt{1 + (\frac{\alpha}{\beta})^2}sin(\beta t + \varphi) \right)$$ When thinking about the solution which I arrived at, I see it doesn't make sense from a physical point of view, but I don't see my error. The question is what am I missing?

Edit: With all the restrictions on the variables, we have that $C_1$ and $C_2$ are negative real numbers, so we have: $$-K cos(\beta t) -K \frac{\alpha}{\beta} sin(\beta t) = R sin(\beta t + \varphi)$$ Note that $\alpha$, $\beta$, and $K$ are positive, so basic trigonometry... $$-1(K cos(\beta t)+ K \frac{\alpha}{\beta} sin(\beta t)) = R sin(\beta t + \varphi)$$ $$R = -K \sqrt{1 + (\frac{\alpha}{\beta})^2}$$

• what were you expecting, from a physical point of view? – zaphodxvii Jul 8 '18 at 2:43
• The response of the system (x(t)) should start from zero and after long enough time(t) it should reach steady state x(t) = K – user1949350 Jul 8 '18 at 2:54
• Your solution does this, $x(0)=0$ and $\lim_{t\to\infty}x(t)=K$. – LutzL Jul 8 '18 at 12:31
• It does give the correct final value(as i said "long enough time t"), however it doesn't start from zero, as should the response of this system. – user1949350 Jul 8 '18 at 12:32
• How do you get that it does not start at zero? You even have a double root at zero. If you use some graphics, please share how you computed the angle $\phi$ for it. – LutzL Jul 8 '18 at 12:34

You forgot to multiply with $h(t)$. Everything else looks correct. Note that $R(\cos\phi,\sin\phi)=(\fracαβ,1)$.
Every solution has the form $x(t)=h(t)u(t)$, as the solution is assumed to have $x(t)=0$ for $t<0$. $u$ is a solution for the right side without the $h$ factor, as you computed, with $u(0)=0$, $u'(0)=0$. That this indeed is the solution with the correct initial conditions can be confirmed by inserting the Taylor expansions \begin{align} e^{αt}-\cos(βt)−\fracαβ\sin(βt) &=(1+αt+\frac12(αt)^2+...)-(1-\frac12(βt)^2\pm...)-\fracαβ((βt)-\frac16(βt)^3\pm)+...\\ &=\frac12(α^2+β^2)t^2+\dots, \end{align} so you get a $C^1$ transition at $0$.
Note that in the angle determination for $$K-Ke^{-αt}\left(\cos(βt)+\fracαβ\sin(βt)\right)=K-R\,e^{-αt}\sin(βt+φ)$$ you will need $R\,(\cos(φ),\sin(φ))=K\,(\fracαβ,1)$ where the right side is in the first quadrant by construction and thus $R=K\sqrt{1+(\fracαβ)^2}$ and $φ=\arctan(\fracβα)$.
• I'm sorry I don't understand what you mean. Why the Taylor expansion? I was suspecting that it had something to do with the formula for $R$ and my assumption that it had to be positive, as when I'd take the - value (the squareroot) I'd get the correct answer. Further more, the solution before turning the sum of sine and cosine into one sine is correct, while the final one isn't. Please correct me if I'm wrong – user1949350 Jul 8 '18 at 12:13
• Taylor to confirm the correctness of your solution. Changing to the phase form should not change the correctness, as it is the same function with the same function values. You should get that $\sqrt{1+(\fracαβ)^2}\sin(φ)=1$. – LutzL Jul 8 '18 at 12:29