Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The given question is: $$ dy/dt + 2y = 1\ ;\qquad y(0)= 5/2 $$ when i solve this i get $\ln(-4)=c$ now the problem is how to solve $\ln(-4)$?

share|cite|improve this question
You must have made some mistake. (The general solution is $y(t)=1/2 + Ae^{-2t}$. No need to take any logarithms to determine $A$.) – Hans Lundmark Apr 9 '11 at 11:37
The mistake you probably made is that the integral $\int \frac{du}{u}$ is not $\ln (u)+C$; it is $\ln |u|+C$. – N. S. Apr 9 '11 at 19:43
@user9176: When working strictly in real numbers at least. All of the other answers here seem way too involved for such a simple problem. – anon Jul 8 '11 at 8:42

You can get rid of the "arbitrary constant" as follows.

Cauchy's problem:

$$\tag{1} \begin{cases} y^\prime (t) +2y(t)=1 \\ y(0)=5/2 \end{cases}$$

has unique global solution (because the ODE is linear with constant coefficients); this solution is continuous in $\mathbb{R}$, hence $y^\prime (t)=1-2y(t)$ is continuous in $\mathbb{R}$ and $y(t)$ is of class $C^1$ in $\mathbb{R}$... Bootstrapping one gets $y(t)$ of class $C^\infty$ in $\mathbb{R}$.

Moreover, the ODE in (1) has only one constant solution, namely $\bar{y}(t):=1/2$, and it forces its nonconstant global solutions to be either $>1/2$ or $<1/2$ everywhere in $\mathbb{R}$: in fact, if a solution $\phi(t)$ has $\phi(t_1)<1/2<\phi(t_2)$, then (by continuity) there exists $T$ s.t. $\phi(T)=1/2$ therefore $\phi(t)=\bar{y}(t)$ everywhere (by uniqueness), a contradiction. In the present case, since $y(0)=5/2>1/2$, one has $y(t)>1/2$ everywhere in $\mathbb{R}$; hence $y^\prime (t)=1-2y(t)<0$ in $\mathbb{R}$, so that $y(t)$ is strictly decreasing.

Now, let $t>0$; one can divide both sides of $y^\prime (t)=1-2y(t)$ by $1-2y(t)\neq 0$ and integrate over $[0,t]$ to get:

$$\int_0^t \frac{y^\prime (\tau)}{1-2y(\tau)}\ \text{d} \tau = \int_0^t \text{d} \tau \; ;$$

since $y(\tau)$ is of class $C^\infty$ and strictly decreasing, one can make the change of variable $\eta = y(\tau)$ in the LHside to get:

$$\int_{5/2}^{y(t)} \frac{1}{1-2\eta}\ \text{d} \eta =t\; ,$$


$$-\frac{1}{2}\log |1-2\eta|\Big|_{5/2}^{y(t)}=t \; ;$$

keeping in mind that $1-2y(t)$ is negative in $\mathbb{R}$, one finds:

$$\log \frac{4}{2y(t)-1} =2t$$

and finally:

$$\tag{2} y(t)=2e^{-2t}+\tfrac{1}{2} \; .$$

On the other hand, if $t<0$ one has to integrate over $[t,0]$ to recover the same elementary expression (2) for the solution. Therefore (2) gives the unique global solution to problem (1).

share|cite|improve this answer

Here I wanted to give a slight different approach to solving the problem without using the integrating factor or the above more slightly involved but elegant way of solving. I will show a method of solving certain non-homogeneous ordinary differential equations called:

$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ {\underline{\textbf{Method of Undetermined Coefficients}}}$



${\underline{\text{Differential Equation:}}}~~~~~~~~~~~~~~~~~$ $y'+2y=1$.

${\underline{\text{Homogeneous Case:}}}~~~~~~~~~~~~~~~~~~~~$ $y'+2y=0$.

${\underline{\text{Characteristic Polynomial:}}}~~~~~~~~~$ $r+2=0$.

${\underline{\text{Solved:}}}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$ $r=-2$

$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~$ $ r=\:-2 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{\text{(Root of characteristic polynomial)}}$

$${\underline{\text{General Form of the Homogeneous Solution}}}$$


$${\underline{\text{Homogeneous Solution to the Differential Equation}}}$$ $$y_{h}(t)=C_{1}e^{-2t}$$

Now we shall seek a particular solution.

${\underline{\text{Non-Homogeneous Case:}}}~~~~~~~~~~~~~~~~$ $y'+2y=1$

$$ f(t)=1 $$


$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \begin{array}{llll} y_{p}(t)=A \\ y_{p}'(t)=0 \end{array}$

Substituting derivatives into differential equation:



After computing the undetermined coefficient ${\underline{A}}$ we get the following solution:

$ \begin{array}{l} A=~\dfrac{1}{2} \end{array} $

Making our particular solution to become,

$$ y_{p}(t)=\dfrac{1}{2} $$

So now we have enough information to put together our complete solution composed of the homogeneous part plus the particular part to get:

$${\underline{\text{General Solution and Particular Solution to ODE Combined}}}$$ $$ y(t)=y_{h}~+~y_{p} $$ $\hspace{2.8999in} y(t)=C_{1}e^{-2t}+\dfrac{1}{2}.$

$\hspace{0.5in} {\underline{\text{Initial Conditions}}}$

$ \begin{array}{lll} y(0)=\dfrac{5}{2}:~ \dfrac{5}{2}=C_{1}e^{-2(0)}+\dfrac{1}{2} \\ ~~~~~~~~~~~~~~~~~~~\dfrac{5}{2}=C_{1} \cdot 1+\dfrac{1}{2} \\ ~~~~~~~~~~~~~~~~~~~\dfrac{5}{2}=C_{1}+\dfrac{1}{2} \\ ~~~~~~~~~~~~~~~~~~~\dfrac{5}{2}-\dfrac{1}{2}=C_{1} \\ ~~~~~~~~~~~~~~~~~~~\dfrac{4}{2}=C_{1} \\ ~~~~~~~~~~~~~~~~~~~~2=C_{1} \end{array} $

Giving us our desired components to build our solution as the following:

$${\underline{\text{Particular Solution to The IVP}}}$$

$\hspace{2.6in} y_{p}(t)=2e^{-2t}+\dfrac{1}{2}. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\Box$

Hope that this helped help to see an alternative way of going about solving the same problem. Let me know if there is anything needed to be further clarified in the steps of work.



share|cite|improve this answer

You have made a mistake with your calculation. Let $\phi(t) = 2y(t) - 1$. Hence, we get $\frac{d \phi}{dt} = 2 \frac{dy}{dt}$.

The equation now becomes $\frac1{2} \frac{d \phi}{dt} + \phi(t) = 0$ with $\phi(0) = 4$.

The solution is $\phi(t) = \phi(0) \exp(-2t) = 4 \exp(-2t)$

Hence, $y(t) = \frac1{2} + 2 \exp(-2t)$

share|cite|improve this answer

this is a linear differential equation and the solution of this equation is as follow:

IF= = e^∫▒〖2 dt〗 = e^2t Now solution of equation is: y e^2t = ∫▒〖1 .e^2t dt〗 y e^2t = e^2t/2 + c ……………………….eq(1) Now put t=0 and y = 5/2 5/2 = 1/2+ c C = 2 Putting this in eq(1), we get y e^2t = e^2t/2+ 2 y=1/2+ 1/2 e^(-2t)

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.