# For method of undetermined coefficients, what is the forcing term for a differential term?

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.

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

## 1 Answer

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$.

• I'm ultimately sorry, $x(t) = 0$ for $t < 0$. Such a horrible typo. – EECSMajor90 Jul 1 '14 at 19:08
• @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. – user147263 Jul 1 '14 at 19:26
• 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. – EECSMajor90 Jul 2 '14 at 3:09
• @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)'$. – user147263 Jul 2 '14 at 3:14