2
$\begingroup$

I am trying to use variation of parameters to find the general solution to the inhomogeneous ODE $$u''-u=\frac{2}{e^x+1}$$

By computing the characteristic polynomial of the homogeneous equation $u''-u=0$, I have found $$u_H=c_1e^x+c_2e^{-x} \ \ \ \ c_1,c_2\in\mathbb{R}$$ Hence $u_1(x)=e^x, u_2(x)=e^{-x}$. So, \begin{align} v'_1(x)&=-\frac{u_2(x)f(x)}{W(x)} \\ v_1(x)&=\int \frac{e^{-x}}{e^x+1} \ dx \\ &=-e^{-x}+\ln|e^{-x}+1|+C_1 \end{align}

and similarly, \begin{align} v'_2(x)&=\frac{u_1(x)f(x)}{W(x)} \\ v_2(x)&=-\int \frac{e^{x}}{e^x+1} \ dx \\ &=-\ln|e^{x}+1|+C_2 \end{align}

Hence the general solution is given by $$u(x)=v_1(x)u_1(x)+v_2(x)u_2(x)=\left(-e^{-x}+\ln|e^{-x}+1|+C_1\right)e^x+\left(-\ln|e^{x}+1|+C_2\right)e^{-x}$$ But this is incorret. Is my method valid?

$\endgroup$
9
  • $\begingroup$ I have got$$u_p=-e^{-x}\log(e^x+1)+e^x(-e^{-x}+\log(e^x+1))$$ $\endgroup$ Commented Aug 5, 2018 at 12:01
  • $\begingroup$ Indeed that is what I have determined. The solution that I have found has $$u_p=e^x\ln(1+e^{-x})-xe^x-e^{-x}\ln(1+e^x)-1$$ which does not make much sense to me. $\endgroup$ Commented Aug 5, 2018 at 12:05
  • $\begingroup$ I think the $-xe^x$ is wrong $\endgroup$ Commented Aug 5, 2018 at 12:07
  • $\begingroup$ I think so as well. I thought I might upload it to MSE as university literature (which is where the question is from) is very rarely found with mistakes. I might raise this with the lecturer. Thanks $\endgroup$ Commented Aug 5, 2018 at 12:11
  • 1
    $\begingroup$ Oh nice, and it is great that i could help you! $\endgroup$ Commented Aug 8, 2018 at 12:23

3 Answers 3

2
$\begingroup$

For particular solution, we can use differential operator method for $D(u''-u)=\dfrac{2}{e^x+1}$ then $$(D^2-1)u=\frac{2}{e^x+1}$$ $$u=\dfrac{1}{D-1}\left(\dfrac{1}{D+1}(\frac{2}{e^x+1})\right)$$ let $v=\dfrac{1}{D+1}(\dfrac{2}{e^x+1})$ then $$e^xv'+e^xv=\dfrac{2e^x}{e^x+1}$$ gives the function $v=e^{-x}\int\dfrac{2e^x}{e^x+1}dx=2e^{-x}\ln(e^x+1)$. Now $$u=\dfrac{1}{D-1}\left(2e^{-x}\ln(e^x+1)\right)$$ or $$e^{-x}u'-e^{-x}u=2e^{-2x}\ln(e^x+1)$$ therefore $$u=e^{x}\int2e^{-2x}\ln(e^x+1)dx=\color{blue}{e^x\ln\left(e^{-x}+1\right)-e^{-x}\ln \left(e^x+1\right)-1}$$

$\endgroup$
2
$\begingroup$

First, $$W(x)=\det\left(\begin{bmatrix}\exp(x)&\exp(-x)\\\exp(x)&-\exp(-x)\end{bmatrix}\right)=-2\,.$$
That is, with a proper constant of integration, $$\begin{align}v_1(x)&=-\int\,\frac{u_2(x)\,f(x)}{W(x)}\,\text{d}x \\&=-\exp(-x)+\ln\big(1+\exp(-x)\big)=-\exp(-x)-x+\ln\big(1+\exp(x)\big)\,.\end{align}$$ Likewise, for an appropriate choice of the constant of integration, we have $$v_2(x)=+\int\,\frac{u_1(x)\,f(x)}{W(x)}\,\text{d}x=-\ln\big(1+\exp(x)\big)\,.$$ Thus, a particular solution is $$\begin{align}u_p(x)&=v_1(x)\,u_1(x)+v_2(x)\,u_2(x) \\&=\small\exp(+x)\,\Big(-\exp(-x)-x+\ln\big(1+\exp(x)\big)\Big)-\exp(-x)\,\ln\big(1+\exp(x)\big) \\ &=-1-x\,\exp(x)+2\,\sinh(x)\,\ln\big(1+\exp(x)\big)\,.\end{align}$$ Hence, the general solutions are of the form $$u(x)=u_p(x)+a\,\exp(+x)+b\,\exp(-x)\,,$$ where $a$ and $b$ are constants. My result agrees with you.


Alternatively, note that $$\frac{\text{d}}{\text{d}x}\,\exp(x)\,\big(u'(x)-u(x)\big)=\frac{2\,\exp(x)}{\exp(x)+1}\,.$$ That is, $$u'(x)-u(x)=\int\,\frac{\exp(x)}{\exp(x)+1}\,\text{d}x=2\,\exp(-x)\,\ln\big(\exp(x)+1\big)-2A\,\exp(-x)$$ for some constant $A$. That is, $$\frac{\text{d}}{\text{d}x}\,\exp(-x)\,u(x)=2\,\exp(-2x)\,\ln\big(\exp(x)+1\big)-2A\,\exp(-2x)\,.$$ Ergo, $$u(x)=\exp(+x)\,\int\,2\,\exp(-2x)\,\ln\big(\exp(x)+1\big)\,\text{d}x+A\,\exp(-x)\,.$$ Using integration by parts, we obtain $$\int\,2\,\exp(-2x)\,\ln\big(\exp(x)+1\big)\,\text{d}x=-\exp(-x)-x+2\exp(-x)\,\sinh(x)\,\ln\big(1+\exp(x)\big)+B$$ for some constant $B$, and so we conclude that $$u(x)=-1-x\,\exp(x)+2\,\sinh(x)\,\ln\big(1+\exp(x)\big)+A\,\exp(-x)+B\,\exp(+x)\,.$$

$\endgroup$
1
$\begingroup$

$$u''-u=\frac{2}{e^x+1}$$ $$u''-u'+u'-u=\frac{2}{e^x+1}$$ Substitute $s=u'-u$ $$s'+s=\frac{2}{e^x+1}$$ $$(se^x)'=\frac{2e^x}{e^x+1}$$ Integrating $$se^x=2\ln({e^x+1})+K_1$$ $$(u'-u)e^{-x}=2e^{-2x}\ln({e^x+1})+K_1e^{-2x}$$ $$(ue^{-x})'=2e^{-2x}\ln({e^x+1})+K_1e^{-2x}$$ After integration $$u=2e^x\int \ln({e^x+1})e^{-2x}dx+K_1e^{-x}+K_2e^x$$ $$u=-\ln({e^x+1})e^{-x}+e^x\int \frac {e^{-x}}{e^x+1}dx+K_1e^{-x}+K_2e^x$$ Finally $$u(x)=-\ln({e^x+1})e^{-x}+e^x\ln( {e^{-x}+1})-1+K_1e^{-x}+K_2e^x$$ or $$u(x)=\ln({e^x+1})(-e^{-x}+e^x)-1-xe^x+K_1e^{-x}+K_2e^x$$


Edit

I think the $−xe^x$ is wrong

It's not wrong I think it comes from the $$e^x\ln(e^{-x}+1)=e^x\ln (e^x+1)-xe^x$$

$\endgroup$
8
  • $\begingroup$ I don't quite understand. Could you please explain your edit. $\endgroup$ Commented Aug 5, 2018 at 23:35
  • $\begingroup$ @Bell Is this more clear ? $$e^x\ln(e^{-x}+1)=e^x\ln(\frac 1 {e^x}+1)=e^x\ln (e^x+1)-e^x\ln {e^x}$$ $\endgroup$ Commented Aug 5, 2018 at 23:50
  • 1
    $\begingroup$ ok @Bell have a nice day $\endgroup$ Commented Aug 6, 2018 at 1:19
  • 1
    $\begingroup$ We were correct :) $\endgroup$ Commented Aug 8, 2018 at 6:45
  • 1
    $\begingroup$ oh thats great @Bell $\endgroup$ Commented Aug 8, 2018 at 7:29

You must log in to answer this question.