Example 2: Solve
.
Solution: First we multiply both sides with
to obtain
. Divide both sides of the equation with
to obtain
. Finally rewrite this as
. Since we have separated variables we integrate both sides.
> int(1/y,y)=int(x*exp(x)+2,x);
We can solve this explicitly in
.
> solve(ln(y) = x*exp(x)-exp(x)+2*x,y);
To check that this is indeed a solution we first make it as a function of
using Maple command
unapply
together with
%
, which in Maple denotes Maple expression that was last executed.
> y:=unapply(%,x);
We will plug this back in the original equation, and using Maple command
simplify
we should get
as the answer.
> simplify(D(y)(x)-y(x)-y(x)*(x*exp(x)+1));