Differential Equation Exercise  

Consider the first-order differential equation with initial condition:

$$ \begin{cases} y' = y - 1 \\ \\ y(0) = 7 \end{cases} $$

This is a Cauchy problem, since the value $y(0) = 7$ is prescribed.

It is also a linear differential equation of the form $y' + a(x)y = b(x)$, here with $a(x) = -1$ and $b(x) = -1$:

$$ y' - y = -1 $$

We solve it using the method of variation of constants:

$$ y = e^{-\int a(x)\, dx}\,\Bigg(\int b(x)\, e^{\int a(x)\, dx}\, dx + c \Bigg). $$

Substituting $a(x) = -1$ and $b(x) = -1$ gives

$$ y = e^{-\int -1\, dx}\,\Bigg(\int -1 \cdot e^{\int -1\, dx}\, dx + c \Bigg). $$

Since $\int -1\, dx = -x$, this becomes

$$ y = e^x \,\Big( - \int e^{-x}\, dx + c \Big). $$

The integral $\int e^{-x}\, dx = -e^{-x}$, so

$$ y = e^x \,\big( -(-e^{-x}) + c \big) $$

$$ y = e^x \,( e^{-x} + c ) $$

$$ y = 1 + c e^x. $$

Thus, the general solution is

$$ y = c e^x + 1. $$

Applying the initial condition $y(0) = 7$:

$$ 7 = c e^0 + 1 \quad \Rightarrow \quad c = 6. $$

Hence, the particular solution of the Cauchy problem is

$$ y = 6e^x + 1. $$

Verification. The solution satisfies $y(0) = 7$.
solution of the Cauchy problem
Substituting $y = 6e^x + 1$ into $y' = y - 1$ gives $$ y' = y - 1, \qquad D(6e^x + 1) = (6e^x + 1) - 1, $$ $$ 6e^x = 6e^x, $$ confirming the identity.

    Alternative approach

    The equation can also be solved by separation of variables:

    $$ \frac{dy}{dx} = y - 1 $$

    $$ \frac{1}{y-1}\, dy = dx. $$

    Integrating both sides,

    $$ \int \frac{1}{y-1}\, dy = \int dx $$

    gives

    $$ \log|y-1| = x + c. $$

    Exponentiating,

    $$ y - 1 = \pm e^{x+c}. $$

    Using the initial condition $y(0) = 7$:

    $$ 6 = \pm e^c. $$

    Since the right-hand side must be positive, we select the plus sign:

    $$ y - 1 = e^{x+c}. $$

    Note. The $\pm$ can be absorbed into the constant: $$ y - 1 = \pm e^{x+c} = (\pm e^c)\, e^x = c e^x. $$ Thus, the solution simplifies to $$ y - 1 = c e^x. $$

    Hence, the general solution is

    $$ y = c e^x + 1, $$

    and with $c = 6$ we recover the same particular solution:

    $$ y = 6e^x + 1. $$

     

     
     

    Please feel free to point out any errors or typos, or share suggestions to improve these notes. English isn't my first language, so if you notice any mistakes, let me know, and I'll be sure to fix them.

    FacebookTwitterLinkedinLinkedin
    knowledge base

    Differential Equations

    First-Order Differential Equations

    Second-Order Differential Equations

    Higher-Order Linear Equations

    Examples and Practice Problems

    Theory

    Approximate Solutions