Nonhomogeneous second order ODE constant external force I've been trying to solve this equation $$-\mu u'' + \beta u' = 1$$
where $u(0) = 0$, $u'(1) = 1$. So far the result I have is $$u = \frac{(exp(\frac{\beta x}{\mu})-1)\mu}{\beta exp(\frac{\beta}{\mu})}$$ but when I tried to substitute it on the equation the result is not the same.
What am I missing? I know that to get the solution we have to find two "solutions" the general and the specific one, can anyone explain how to solve this?
 A: Break the problem up into two parts: getting the general solution of the homogeneous problem as well as finding a particular solution to the nonhomogeneous problem.
Homogeneous ODE: $-\mu u''+\beta u'=0$
Use the standard methods for second order, linear, constant coefficient ODEs to get $u_h(x)=c_1+c_2e^{\beta x/\mu}$, the general solution of the homogeneous problem.
Nonhomogeneous ODE: $-\mu u''+\beta u'=1$
There are multiple methods to find a particular solution $u_p$ of the nonhomogeneous problem. I prefer the method of undetermined coefficients here, but your mileage may vary. Doing so yields $u_p(x)={1\over \beta}x$.
Then, the general solution to the nonhomgeneous problem is $u(x)=u_h(x)+u_p(x)$.
Finally, you would need to apply the two given boundary conditions to find the two constants in $u(x)$, but this is just a little calculus and algebra.
A: Assuming $\mu$ and $\beta$ are constants, you could immediately integrate both sides.  However, in this case, it might be easier to proceed like this.
$$u''-\frac\beta\mu u'=-\frac1\mu$$
$$e^{-\frac\beta\mu x}u''-\frac\beta\mu e^{-\frac\beta\mu x}u'=(e^{-\frac\beta\mu x}u')'=-\frac1\mu$$
$$e^{-\frac\beta\mu x}u'=-\frac1\mu x+C$$
$$u'=-\frac1\mu xe^{\frac\beta\mu x}+Ce^{\frac\beta\mu x}$$
We can evaluate our first constant now.  Had we just integrated both sides from the beginning, we would have to wait as our initial values are for 2 different values of $x$.
$$1=-\frac1\mu e^{\frac\beta\mu}+Ce^{\frac\beta\mu}$$
$$C=e^{-\frac\beta\mu}+\frac1\mu$$
Are you sure you copied those initial values correctly by the way?  Ah well, from here you have $u'=f(x)$.  Integrate both sides and use $u(0)=0$ for your final answer.
