# Maple/常微分方程

## 线性常微分方程

dsolve(diff(y(x), x, x) = y(x))

${\displaystyle y(x)=C1*exp(x)+C2*exp(-x)}$

f := diff(y(x), x, x)+a^2*y(x);

${\displaystyle y(x)=_{C}1*sin(a*x)+_{C}2*cos(a*x)}$

${\displaystyle a*{\frac {d^{2}x}{dx^{2}}}+b*{\frac {dy}{dx}}+cy+d=0}$

Maple:

${\displaystyle f:=a*(diff(y(x),x,x))+b*(diff(y(x),x))+cy+d=0}$

dsolve(f);

${\displaystyle y(x)={\frac {-a*exp(-b*x/a)*_{C}1}{b}}-{\frac {(cy+d)*x}{b}}+_{C}2}$

dsolve(diff(y(x), x, x, x, x) = y(x));

y(x) = _C1*exp(x)+_C2*exp(-x)+_C3*sin(x)+_C4*cos(x)

dsolve(diff(y(x), x, x, x, x, x, x, x) = diff(y(x), x, x))

y(x) = _C1+_C2*x+_C3*exp(x)-_C4*exp((-1/4-(1/4)*sqrt(5))*x)*sin((1/4)*sqrt(2)*sqrt(5-sqrt(5))*x)-_C5*exp((-1/4+(1/4)*sqrt(5))*x)*sin((1/4)*sqrt(2)*sqrt(5+sqrt(5))*x)+_C6*exp((-1/4-(1/4)*sqrt(5))*x)*cos((1/4)*sqrt(2)*sqrt(5-sqrt(5))*x)+_C7*exp((-1/4+(1/4)*sqrt(5))*x)*cos((1/4)*sqrt(2)*sqrt(5+sqrt(5))*x)

${\displaystyle f:=a*{\frac {d^{3}y}{dx^{3}}}+b*{\frac {d^{2}y}{dx^{2}}}+c*{\frac {dy}{dx}}+d*y=e}$

Maple 式：

${\displaystyle f:=a*(diff(y(x),x,x,x))+b*(diff(y(x),x,x))+c*(diff(y(x),x))+d*y(x)=e}$

dsolve(f);

y(x) = e/d+_C1*exp((1/6)*((36*c*b*a-108*d*a^2-8*b^3+12*sqrt(3)*sqrt(4*c^3*a-c^2*b^2-18*c*b*a*d+27*d^2*a^2+4*d*b^3)*a)^(2/3)-12*c*a+4*b^2-2*b*(36*c*b*a-108*d*a^2-8*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)*sqrt(4*c^3*a-c^2*b^2-18*c*b*a*d+27*d^2*a^2+4*d*b^3)*a)^(1/3)))

## 分离变数型微分方程

${\displaystyle {\frac {d(x)}{dx}}=f(t)*g(x)}$

• Maple 可以直接得出解答，无需用户作分离变数步骤。
• ${\displaystyle {\frac {dy(x)}{dx}}={\frac {1+y(x)^{2}}{1+x^{2}}}}$
• f := diff(y(x), x) = (1+y(x)^2)/(1+x^2)；
• dsolve(f);
• ${\displaystyle y(x)=tan(arctan(x)+_{C}1)}$

${\displaystyle {\frac {dy(x)}{dx}}={\frac {(1+y(x)^{2})*(1+1/x)}{1+x^{2}}}}$

• f := diff(y(x), x) = (1+y(x)^2)*(1+1/x)/(1+x^2)
• dsolve(f);
• ${\displaystyle y(x)=tan(ln(x)-(1/2)*ln(1+x^{2})+arctan(x)+_{C}1)}$

${\displaystyle f:={\frac {d(x(t)}{dt}}={\frac {(x(t)^{2}+t^{2})}{t*x(t)}}}$

### 欧拉型微分方程

${\displaystyle {\frac {dx}{dt}}={\frac {P(x,t)}{Q(x,t)}}}$

• f := diff(x(t), t) = (x(t)^2+t^2)/(t*x(t))
• dsolve(f);
• ${\displaystyle x(t)={\sqrt {2*ln(t)+_{C}1}}*t}$ ,
• ${\displaystyle x(t)=-{\sqrt {2*ln(t)+_{C}1}}*t}$

${\displaystyle f:={\frac {dx}{dt}}={\frac {x+t}{5x+t}}}$

• dsolve(f);
• ${\displaystyle x(t)=-(1/5)*t-(1/5)*{\sqrt {t^{2}-10*t+10*_{C}1}}}$
• ${\displaystyle x(t)=-(1/5)*t+(1/5)*{\sqrt {t^{2}-10*t+10*_{C}1}}}$

## 伯努利微分方程

${\displaystyle {\frac {dx}{dt}}}$ ${\displaystyle =A(t)*x+B(t)*x^{a}}$

${\displaystyle {\frac {dx(t)}{dt}}=5*x(t)/t+t*{\sqrt {x(t)}}}$

f := diff(x(t), t) = 5*x(t)/t+t*x(t)^(1/2)

• dsolve(f);
• ${\displaystyle {\sqrt {x(t)}}+t^{2}-t^{(}5/2)*_{C}1=0}$

## Riccati 型微分方程

${\displaystyle A(t)x^{3}+B(t)x+C}$

${\displaystyle f:={\frac {d(x(t)}{dt}}=sin(t)*x(t)^{2}+2*{\frac {sin(t)}{cos(t)^{2}}}}$

• f := diff(x(t), t) = sin(t)*x(t)^2+2*sin(t)/cos(t)^2
• dsolve(f);
• ${\displaystyle x(t)=-(1/14)*(-{\sqrt {(}}7)+}$ ${\displaystyle 7*tan((1/2*(ln(cos(t))+_{C}1))*{\sqrt {(}}7)))*{\sqrt {(}}7)/cos(t)}$

${\displaystyle f:={\frac {d(x(t)}{dt}}=t^{5}*x(t)^{2}+5*x(t)/t+6/t^{2}}$

• f := diff(x(t), t) = t^5*x(t)^2+5*x(t)/t+6/t^2
• dsolve(f);
• ${\displaystyle x(t)={\frac {-{\sqrt {(}}6)*(BesselJ(6/5,(2/5)*{\sqrt {(}}6)*t^{(}5/2))+_{C}1*BesselY(6/5,(2/5)*{\sqrt {(}}6)*t^{(}5/2)))}{(t^{(}7/2)*(_{C}1*BesselY(11/5,(2/5)*{\sqrt {(}}6)*t^{(}5/2))+BesselJ(11/5,(2/5)*{\sqrt {(}}6)*t^{(}5/2))))}}}$

## 非线性常微分方程

${\displaystyle f=(1-x^{2})*{\frac {d^{2}y(x)}{dx^{2}}}-2*x*{\frac {dy(x)}{dx}}+l(l+1)}$

f := (1-x^2)*(diff(y(x), x, x))-2*x*(diff(y(x), x))+l*(l+1);

> dsolve(f);

y(x) = (1/2)*ln(x-1)*_C1+(1/2)*ln(x-1)*l^2+(1/2)*ln(x-1)*l-(1/2)*ln(x+1)*_C1+(1/2)*ln(x+1)*l^2+(1/2)*ln(x+1)*l+_C2

${\displaystyle f=x^{2}*{\frac {d^{2}y(x)}{dx^{2}}}+x*{\frac {dy(x)}{dx}}+(x^{2}-v^{2})*y}$

f := x^2*(diff(y(x), x, x))+x*(diff(y(x), x))+(x^2-v^2)*y(x)

dsolve(f);

y(x) = _C1*BesselJ(v, x)+_C2*BesselY(v, x)

${\displaystyle f=(1-x^{2})*{\frac {d^{2}y(x)}{dx^{2}}}-2*x*{\frac {dy(x)}{dx}}+l(l+1)*y}$

f := (1-x^2)*(diff(y(x), x, x))-2*x*(diff(y(x), x))+l(l+1)*y(x);

dsolve(f);

y(x) = _C1*LegendreP((1/2)*sqrt(1+4*l(l+1))-1/2, x)+_C2*LegendreQ((1/2)*sqrt(1+4*l(l+1))-1/2, x)

${\displaystyle {\frac {dy(x)}{d^{2}x}}-x*{\frac {dy(x)}{dx}}+n*y(x)}$

f := diff(y(x), x, x)-x*(diff(y(x), x))+n*y(x);

dsolve(f);

y(x) = _C1*KummerM(1/2-(1/2)*n, 3/2, (1/2)*x^2)*x+_C2*KummerU(1/2-(1/2)*n, 3/2, (1/2)*x^2)*x

${\displaystyle x*{\frac {d^{3}y(x)}{d^{3}x}}+x*{\frac {dy(x)}{dx}}+y(x)-1}$

f := x*(diff(y(x), x, x, x))+x*(diff(y(x), x))+y(x)-1

dsolve(f);

y(x) = x*BesselJ(1, x)*_C3+x*BesselY(1, x)*_C2+(1/4)*π*x*(-BesselJ(1, x)*BesselY(0, x)+BesselY(1, x)*BesselJ(0, x))*(Pi*x*_C1*StruveH(-1, x)-2)

${\displaystyle {\frac {d^{2}y(x)}{d^{2}x}}+x^{3}*{\frac {dy(x)}{dx}}+y(x)-1}$

y(x) = exp(-(1/4)*x^4)*HeunB(-1/2, 0, -3/2, 1, -(1/2)*x^2)*_C2+exp(-(1/4)*x^4)*HeunB(1/2, 0, -3/2, 1, -(1/2)*x^2)*x*_C1+1

${\displaystyle {\frac {d^{2}y(x)}{d^{2}x}}+(1-x^{2})*{\frac {dy(x)}{dx}}+x*y-1}$

f := diff(y(x), x, x)+(1-x^2)*(diff(y(x), x))+x*y(x)-1

dsolve(f);

y(x) = HeunT(0, 6, -3^(1/3), (1/3)*3^(2/3)*x)*_C2+HeunT(0, -6, -3^(1/3), -(1/3)*3^(2/3)*x)*exp((1/3)*x*(-3+x^2))*_C1+x;

${\displaystyle {\frac {d^{2}(x)}{d^{3}x}}-cos(x)*y(x)-1}$

f := diff(y(x), x, x)-cos(x)*y(x)-1

y(x) = MathieuC(0, 2, (1/2)x| _C2 + MathieuS(0, 2, (1/2)x) _C1 - 2 | |

 /        /      1  \\//        /      1  \              /
|MathieuS|0, 2, - x|| |MathieuC|0, 2, - x| MathieuSPrime|0, 2,
\        \      2  // \        \      2  /              \

                                                        \
1  \           /      1  \              /      1  \\   |
- x| - MathieuS|0, 2, - x| MathieuCPrime|0, 2, - x|| dx|
2  /           \      2  /              \      2  //   |
/

                         /  /
/      1  \     | |  /        /      1  \\//        /
MathieuC|0, 2, - x| + 2 | |  |MathieuC|0, 2, - x|| |MathieuC|0,
\      2  /     | |  \        \      2  // \        \
\/

    1  \              /      1  \
2, - x| MathieuSPrime|0, 2, - x|
2  /              \      2  /

                                                    \
/      1  \              /      1  \\   |         /
- MathieuS|0, 2, - x| MathieuCPrime|0, 2, - x|| dx| MathieuS|
\      2  /              \      2  //   |         \
/

       1  \
0, 2, - x|
2  /


>