--Copyright The Numerical Algorithms Group Limited 1996.
)set break resume

-- First Order Equations

-- 1

u := operator 'u
ode := (x^4-x^3)*D(u x,x) + 2*x^4*u(x) = x^3/3 + C
solve(ode,u,x)

-- 2
)clear all

u := operator 'u
ode := -D(u x,x)/2 + u(x) = sin(x)
solve(ode,u,x)

-- 3
)clear all

y := operator 'y
ode := D(y x,x) = y(x)/(y(x)*log(y(x)) + x)
solve(ode,y,x)

-- 4
)clear all

y := operator 'y
ode := 2*y(x)*D(y x,x)^2 -2*x*D(y x,x)-y(x) = 0
solve(ode,y,x)

-- 5
)clear all

y := operator 'y
ode := D(y x,x) + y(x) = y(x)^3*sin(x)
solve(ode,y,x)

-- 6
)clear all 

y := operator 'y
P := operator 'P
Q := operator 'Q
ode := D(y x,x) + P(x)*y(x) = Q(x)*y(x)^n
solve(ode,y,x)
solve(eval(ode,n=1),y,x)
solve(eval(ode,n=2),y,x)
solve(eval(ode,n=%pi),y,x)
solve(eval(ode,n=%e),y,x)
solve(eval(ode,n=sqrt(2)),y,x)

-- 7
)clear all

y := operator 'y
ode := (x^2-1)*D(y x,x)^2 - 2*x*y(x)*D(y x,x)+(y x)^2 - 1 = 0
solve(ode,y,x)

-- 8
)clear all

y := operator 'y
f := operator 'f
g := operator 'g
ode := f(x*D(y x,x) - y(x)) = g(D(y x,x))
solve(ode,y,x)

-- 9
)clear all

y := operator 'y
ode := D(y x,x)  = (3*x^2-y(x)^2-7)/(exp(y(x))+2*x*y(x)+1)
solve(ode,y,x)

-- 10
)clear all

y := operator 'y
ode := D(y x,x)  = (2*x^3*y(x) - (y x)^4)/(x^4 - 2*x*(y x)^3)
solve(ode,y,x)

-- 11
)clear all

y := operator 'y
ode := D(y x,x)*(D(y x,x) + y(x)) = x*(x + y(x))
solve(ode,y,x)

-- 12
)clear all

y := operator 'y
ode := D(y x,x) = x/(x^2*(y x)^2 + (y x)^5)
solve(ode,y,x)

-- 13
)clear all

y := operator 'y
ode := y(x) = 2*x*D(y x,x) - a*D(y x,x)^3
solve(ode,y,x)

-- 14
)clear all

y := operator 'y
ode := y(x) = 2*x*D(y x,x) - D(y x,x)^3
solve(ode,y,x)

-- 15
)clear all

y := operator 'y
ode := D(y x,x) = exp(x)*(y x)^2 - y(x) + exp(-x)
solve(ode,y,x)

-- 16
)clear all

y := operator 'y
ode := D(y x,x) = (y x)^2 - x*y(x) + 1
solve(ode,y,x)

-- 17
)clear all

y := operator 'y
ode := D(y x,x) = (9*x^8 + 1)/((y x)^2 +1)
solve(ode,y,x)

-- 18
)clear all

y := operator 'y
ode := y(x)=2*x*D(y x,x) + y(x)*D(y x,x)^2
solve(ode,y,x)

-- 19
)clear all
y := operator 'y
ode := x = y(x)*D(y x,x) - x*D(y x,x)^2
solve(ode,y,x)

-- Second Order Equations

-- 20
)clear all
y := operator 'y
ode := D(y x,x,2)*(a*x+b)^2+4*D(y x,x)*(a*x+b)*a+2*y(x)*a^2=0
solve(ode,y,x)

-- 21
)clear all
u := operator 'u
ode := (x^2 - x)*D(u x,x,2) + (2*x^2+4*x-3)*D(u x,x) + 8*x*u(x)=1
solve(ode,u,x)

-- 22
)clear all
w := operator 'w
ode := (x^2 - x)*D(w x,x,2) + (1-2*x^2)*D(w x,x) + (4*x - 2)*w(x) = 0
solve(ode,w,x)

-- 23
)clear all
y := operator 'y
ode := D(y x,x,2) - D(y x,x) = 2*y(x)*D(y x,x)
solve(ode,y,x)

-- 24
)clear all
y := operator 'y
ode := D(y x,x,2)/y(x) - D(y x,x)^2/y(x)^2 -1 + y(x)^(-3) = 0
solve(ode,y,x)

-- 25
)clear all
y := operator 'y
ode :=  D(y x,x,2) + 2*x*D(y x,x) = 2*x
solve(ode,y,x)

-- 26
)clear all
y := operator 'y
ode := 2*y(x)*D(y x,x,2) - D(y x,x)^2 = (D(y x,x) - x*D(y x,x,2))^2/3
solve(ode,y,x)

-- 27
)clear all
y := operator 'y
ode := x*D(y x,x,2) = 2*y(x)*D(y x,x)
solve(ode,y,x)

-- 28
)clear all
y := operator 'y
ode := (1-x)*(y(x)*D(y x,x,2) - D(y x,x)^2) + x^2*y(x)^2 = 0
solve(ode,y,x)

-- 29
)clear all
y := operator 'y
ode := x*y(x)*D(y x,x,2) + x*D(y x,x)^2 + y(x)*D(y x,x) = 0
solve(ode,y,x)

-- 30
)clear all
y := operator 'y
ode := D(y x,x,2)^2 - 2*D(y x,x,2)*D(y x,x) + 2*y(x)*D(y x,x) -y(x)^2 = 0
solve(ode,y,x)

-- 31 
)clear all
y := operator 'y
ode := (x^3/2-x^2)*D(y x,x,2) + (2*x^2-3*x+1)*D(y x,x) + (x-1)*y(x) = 0
solve(ode,y,x)

-- 32
)clear all
y := operator 'y
ode := D(y x,x,2) - 2*x*D(y x,x) + 2*y(x) = 3
solve(ode,y,x)

-- 33
)clear all
y := operator 'y
ode := sqrt(x)*D(y x,x,2) + 2*x*D(y x,x) + 3*y(x) = 0
solve(ode,y,x)

-- 34
)clear all
y := operator 'y
ode := x^2*D(y x,x,2) + 3*x*D(y x,x) = 1/(x^4*y(x)^3)
solve(ode,y,x)

-- 35
)clear all
y := operator 'y
ode := D(y x,x,2) - 2/x^2*y(x) = 7*x^4 +3*x^3
solve(ode,y,x)

-- 36
)clear all
y := operator 'y
ode := D(y x,x,2) +y(x) = csc(x)
solve(ode,y,x)

-- Higher Order Equations

-- 37
)clear all
y := operator 'y
ode := D(y x,x,7) - 14*D(y x,x,6) +80*D(y x,x,5) -242*D(y x,x,4) + _
         419*D(y x,x,3) - 416*D(y x,x,2) +220*D(y x,x) -48*y(x) = 0
solve(ode,y,x)

-- 38
)clear all
y := operator 'y
ode := D(y x,x,4) -4/x^2*D(y x,x,2) + 8/x^3*D(y x,x) -8/x^4*D(y x,x) = 0
solve(ode,y,x)

-- 39
)clear all
y := operator 'y
ode := (1+x+x^2)*D(y x,x,3) + (3+6*x)*D(y x,x,2) +6*D(y x,x) = 6*x
solve(ode,y,x)

-- 40
)clear all
y := operator 'y
ode := (D(y x,x)^2 +1)*D(y x,x,3) - 3*D(y x,x)*D(y x,x,2) = 0
solve(ode,y,x)

-- 41
)clear all
y := operator 'y
ode := 3*D(y x,x,2)*D(y x,x,4) - 5*D(y x,x,3)^2 = 0
solve(ode,y,x)

-- Special Equations

-- 42
)clear all
y := operator 'y
ode := D(y t,t) + a*y(t-1) = 0
solve(ode,y,t)

-- 43
)clear all
y := operator 'y
ode := D(y(x,a),x) = a*y(x,a)
solve(ode,y,x)

-- 44
)clear all
y := operator 'y
ode := D(y x,x,4) = sin(x)
solve(ode,y,x=0,[0,0,0,0])

-- 45
)clear all
y := operator 'y
ode := x*D(y x,x,2) + D(y x,x) +2*x*y(x) =0
solve(ode,y,x=0,[1,0])

-- 46
)clear all
y := operator 'y
ode := x*D(y x,x)^2 -(y x)^2 + 1 = 0
solve(ode,y,x=0,[1])

-- 47
)clear all
y := operator 'y
ode := D(y x,x,2) + y(x)*D(y x,x)^3 = 0
solve(ode,y,x=0,[0,2])

-- Systems Of equations

-- 48
)clear all
x := operator 'x
y := operator 'y
z := operator 'z
odes := [D(x t,t) = -3*y(t)*z(t), D(y t,t) = 3*x(t)*z(t), D(z t,t) = -x(t)*y(t)]
solve(odes,[x,y,z],t)

-- 49
)clear all
x := operator 'x
y := operator 'y
a := operator 'a
b := operator 'b
odes := [D(x t,t) = a(t)*((y t)^2 - (x t)^2) + 2*b(t)*x(t)*y(t) + 2*c*x(t),
         D(y t,t) = b(t)*((y t)^2 - (x t)^2) - 2*a(t)*x(t)*y(t) + 2*c*y(t)]
solve(odes,[x,y],t)

-- 50
)clear all
x := operator 'x
y := operator 'y
odes := [D(x t,t) = x(t)*(1+cos(t)/(2+sin(t))), D(y t,t) = x(t) - y(t)]
solve(odes,[x,y],t)

-- 51
)clear all
x := operator 'x
y := operator 'y
odes := [D(x t,t) = 9*x(t) + 2*y(t), D(y t,t) = x(t) + 8*y(t)]
solve(odes,[x,y],t)

-- 52
)clear all
x := operator 'x
y := operator 'y
odes := [D(x t,t) - x(t) - 2*y(t) = 0, D(x t,t,2) - 2*D(y t,t) = 2*t - cos(2*t)]
solve(odes,[x,y],t)

-- 53
)clear all
y1 := operator 'y1
y2 := operator 'y2
odes := [D(y1 x,x) = -1/(x*(x^2 + 1))*y1(x) + 1/(x^2*(x^2 + 1))*y2(x)+1/x,
         D(y2 x,x) = -x^2/(x^2 + 1)*y1(x) + (2*x^2+1)/x/(x^2+1)*y2(x)+1]
solve(odes,[y1,y2],x)

