There is a differential equation I am trying to solve and I have been trying to find a way to solve it using undetermined coefficients so as to find a homogenous solution and non homogeneous solution. Then I would add the results. For example, there is the following:

$\frac{d y(t)}{d t} + y(t) = \frac{d x(t)}{d t} - x(t)$ where $y(0)=1$ and $x(t) = 0$ for $t < 0$ and $x(t)=t$ for all $t > 0$

I tried ridding the RHS by setting it to $0$ so as to find the homogeneous solution. Then I found $y_h(t)$. However, I'm stuck when it comes to finding a forcing term to find the particular solution, $y_p(t)$, such that it can take the place of the right hand side. Any tips? Thanks.

  • $\begingroup$ Do you know the values of $x(t)$ for $t\ge 0$? If not, then I don't know how you would find $y$. $\endgroup$
    – user147263
    Commented Jun 30, 2014 at 22:17
  • $\begingroup$ @Thisismuchhealthier Yes, $x(t)$ for $t >= 0$ is just t. $\endgroup$ Commented Jul 1, 2014 at 15:43

1 Answer 1


So, we have nondifferentiable $x$, $$x(t) = \begin{cases} t,\quad t\ge 0,\\ 0,\quad t<0 \end{cases}$$ but its derivative appears on the right. This looks somewhat problematic, but it really isn't, and a change of dependent variable clears things up. Let's write $y=x+u$ where $u$ is the new unknown function to be found. The equation becomes $u'+u+x = -x$, or $u'+u=-2x$. A standard way to handle this is using the integrating factor, which is $e^{\int 1\,dt} = e^ t$. So, $$(e^t u)' = -2xe^t$$ which is solved by integration. Be careful when integrating the piecewise function on the right: make sure the both pieces of the antiderivative agree at $t=0$.

  • $\begingroup$ I'm ultimately sorry, $x(t) = 0$ for $t < 0$. Such a horrible typo. $\endgroup$ Commented Jul 1, 2014 at 19:08
  • $\begingroup$ @EECSMajor90 When you find a typo in your question, please edit the question to make it right. People should not have to look for errata list in comments. You should include both the correction and the fact that $x(t)=t$ for $t\ge 0$. I edited my answer. $\endgroup$
    – user147263
    Commented Jul 1, 2014 at 19:26
  • $\begingroup$ Why did you make a substitution such that $y(t) = u(t) + x(t)$? Is it because there is an arbitrary independent helper variable $u(t)$ such that the sum of such a variable and the known independent variable, $x(t)$, must equal $y(t)$ for the given constraints? Just wanted to understand why you did that. $\endgroup$ Commented Jul 2, 2014 at 3:09
  • $\begingroup$ @EECSMajor90 I did not like having that $dx/dt$ in the equation, and saw the opportunity to get rid of it. It's a common theme in ODE: absorb terms into others if possible. The integrating factor trick is also kind of like that, turning a sum of two things into one $(e^t u)'$. $\endgroup$
    – user147263
    Commented Jul 2, 2014 at 3:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .