Differentiation and Integration

>    diff(sin(cos(x)*exp(x)),x);


>    diff(sin(cos(x)*exp(x)),[x,x]);


>    int(sin(x)^4*cos(x)^5,x);


Form a differential equation (note that we write y(t) consistently!)

>    de:=diff(y(t),t)=2*(1-y(t)/3)*y(t);

de := diff(y(t),t) = 2*(1-1/3*y(t))*y(t)

Load packages used for differential equations and plots (trailing colon leaves out output)

>    with(plots):with(DEtools):

Warning, the name changecoords has been redefined

plot a direction field. (The plot is a data structure we do not want to see immediately)

>    fplot:=dfieldplot(de,y(t),t=0..10,y=-3..5,arrows=SLIM):

>    display(fplot);

[Maple Plot]

Solve a differential equation using `dsolve'

>    sol:=dsolve(de);

sol := y(t) = 3/(1+3*exp(-2*t)*_C1)

Solve an IVP symbolically

>    sol:=dsolve({de,y(0)=0.1});

sol := y(t) = 3/(1+29*exp(-2*t))

Numerical solution of an IVP

>    sol:=dsolve({de,y(0)=0.1},numeric,range=0..10);

sol := proc (x_rkf45) local res, solnproc, outpoint, ndsol, i; option `Copyright (c) 2000 by Waterloo Maple Inc. All rights reserved.`; _EnvDSNumericSaveDigits := Digits; Digits := 15; if _EnvInFsolve ...

and plot the result

>    display(odeplot(sol,t=0..10));

[Maple Plot]

Plot together with directionfield

>    display(odeplot(sol,color=blue,thickness=4),fplot);

Evaluate the solution

>    sol(5);