Solving second order nonhomogeneous equation with f(x) = constant I'm trying to solve the following for $U(y)$:
$$\frac{{{d^2}U}}{{d{y^2}}} - \frac{V}{v}\frac{{dU}}{{dy}} =  - \frac{G}{{vP}}$$
given boundary conditions $U(0)=U(b)=0$, where $V$, $v$, $G$ and $P$ are all positive constants. I've attempted it using the method of undetermined coefficients, letting the left hand side to be a term consisting of ${e^0}$, but this just led to an overall answer of zero ($U$ can't be zero, it's a component of velocity). The question itself deals with finding the velocity ($i$ and $j$ components) of an incompressible viscous fluid between two plates. If the wording of the question is required I can write it up. Any help would be greatly appreciated!
 A: You can write your equation as follows:
$$W'(y) - \alpha W(y) = - \beta, \quad \alpha , \beta > 0, $$ where $W = U'$. Then, this 1st order linear ODE can be solved in terms of an integrating factor as follows (see here for details, please):
$$\frac{\mathrm{d}}{\mathrm{d}y} \left( e^{-\alpha y}\, W  \right) = - e^{-\alpha y} \, \beta,$$ which leads, after integration, to:
$$ W(y) = \frac{\beta}{\alpha}  + C_1' e^{\alpha y},$$ and, of course, to:
$$ U(y) = C_1 e^{\alpha y} + C_2 + \frac{\beta}{\alpha} y, $$ where $C_1 = C'_1/\alpha$ and $C_2$ are constants of integration. I guess you can take it from here.
Hope this helps.
Cheers!
Some thoughts:


*

*You could have proceeded as you point out in your question. The general solution of the homogenous equation is:
$$U_h(y) = C_1 e^{\alpha y} + C_2,$$ 
since $s = 0, \alpha$ are the roots of the polinomial $s^2 - \alpha s = 0$. One can then find a particular solution which is not of the form $U_p = K \, e^{0\, y}$ for some constant (because $0$ is a root of the characteristic pol.) $K$ but $ K_1 y + K_2 $. It turns out that $K_2 = 0$, $K_1 = \beta / \alpha$.

*You can also apply the method of variation of parameters, which you can see here, by setting $y_1 \to U_1 = e^{\alpha y}$ and $A(x) \to C_1(x)$.

*By reducing the order and introducing $W$, you can directly compute the shear stress on the plates, which is given by $ \propto dU/dy$ at $y=0,b$ (the constant of proportionality depends on your non-dimensionalization).

*The streamwise velocity profile resembles that of Hagen-Poiseuille but has been deformed because of the external pressure gradient (source term) and the effects of convection ($U'$ term).

*You can see the effects of the quantities $\alpha$ and $\beta$ by copying and pasting this into Mathematica:
   u[y_,\[Alpha]_,\[Beta]_,b_]:= ((b-b E^(y \[Alpha])+(-1+E^(b \[Alpha])) y) \[Beta])/((-1+E^(b \[Alpha])) \[Alpha]);
   Manipulate[Plot[u[y,alpha,beta,1],{y,0,1},PlotRange->{0,1}], {beta,0,8,Appearance -> Open"}, {alpha,0.01,20,Appearance -> "Open"}]

it is quite cool!
A: First you should define the new variable $u$ as $u = \frac{{dU}}{{dy}}$. Now, you could see $$\frac{{du}}{{dy}} - \frac{V}{v}u =  - \frac{G}{{vP}}$$ which is a first order ODE. Solving this equation yields $$u(y) = u(0){e^{\frac{V}{v}y}} - \frac{G}{{VP}}\left( {{e^{\frac{V}{v}y}} - 1} \right)$$ Noticing that the undetermined coefficient should be determined in the final step, you could write $$\frac{{dU}}{{dy}} = \alpha {e^{\frac{V}{v}y}} + \frac{G}{{VP}}$$, where $\alpha$ is a constant. Now, by integration, you could see $$U(y) = \beta {e^{\frac{V}{v}y}} + \frac{G}{{VP}}y + \gamma$$, where $\beta$ and $\gamma$ are two newly defined constants. Now, you should use your boundary conditions to determine these two constants, specifically $$\begin{array}{l}U(0) = 0 \to \beta  + \gamma  = 0\\U(b) = 0 \to \beta {e^{\frac{V}{v}b}} + \frac{G}{{VP}}b + \gamma  = 0\end{array}$$ which finally yields $$U(y) = \frac{G}{{VP}}\left( {b - \frac{{{e^{\frac{V}{v}y}} - 1}}{{{e^{\frac{V}{v}b}} - 1}}y} \right)$$
