       Re: How to solve this equation?

• To: mathgroup at smc.vnet.net
• Subject: [mg72188] Re: How to solve this equation?
• From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
• Date: Thu, 14 Dec 2006 05:49:02 -0500 (EST)
• Organization: The Open University, Milton Keynes, UK
• References: <eloqvd\$o2j\$1@smc.vnet.net>

```learner wrote:
> hi,
> I am trying to solve  y'+y tanx=sin(2x)
>
> i wrote NSolve[{Derivative[y][x]+y Tan[x]==Sin[2x]},y,x] but get
> something like
>
> {{y->cot[x](sin[2x]-y`[x]}}
>
> I want to set a restraint to say y=2 when x=0, how shoud i do it?
>
> many thanks!!!
>
For differential equations, the functions that must be used are DSolve
 or NDSolve . (Especially, read the sections called "Further
Examples"). A general presentation can be found in The Mathematica Book.
(For instance see .) Detail explanations of all the intricacies can
be found in .

In:=
DSolve[{Derivative[y][x] + y[x]*Tan[x] == Sin[2*x]}, y, x]

Out=
{{y -> Function[{x}, C*Cos[x] - 2*Cos[x]^2]}}

In:=
DSolve[{Derivative[y][x] + y[x]*Tan[x] == Sin[2*x], y == 2}, y,
x]

Out=
{{y -> Function[{x}, -2*(-2*Cos[x] + Cos[x]^2)]}}

Regards,
Jean-Marc

1. http://documents.wolfram.com/mathematica/functions/DSolve

2. http://documents.wolfram.com/mathematica/functions/NDSolve

3. http://documents.wolfram.com/mathematica/book/section-1.5.9

4.