# Maple/微分

Maple 微分

• Maple 的f 对x 的微分用 f' 或 diff(y,x) 表示。

Maple 的微分运算，可以方便地求出复杂的函数的微分。

• Diff算子，只显示书写形式，不作计算：

Diff(q,x,y,z);

${\displaystyle {\frac {\partial ^{3}}{\partial x\partial y\partial z}}q}$
• 也可以用

diff(x(t),t\$5) 表示${\displaystyle {\frac {d^{5}x(t)}{dt^{5}}}}$

## 常微分

diff(5x^18,x);

${\displaystyle 90*x^{1}7\,}$

diff(ax,x);

${\displaystyle 0\,}$

diff(ax,ax)

${\displaystyle 1\,}$

diff(a*x^2,x);

${\displaystyle 2a*x\,}$
h := (sin(2*x-1)^2)^(3/2);
diff(h,x);
${\displaystyle 6*{\sqrt {(}}sin(2*x-1)^{2})*sin(2*x-1)*cos(2*x-1)}$
y :=${\displaystyle {\sqrt {(}}sin({\sqrt {(}}x)))}$ ;
${\displaystyle y'=(1/4)*cos({\sqrt {(}}x))/({\sqrt {(}}sin({\sqrt {(}}x)))*{\sqrt {(}}x))}$
y :=${\displaystyle {\sqrt {(}}sin({\sqrt {(}}x))^{2}/(1+cos(x)))}$
${\displaystyle y'=(1/2)*(sin({\sqrt {(}}x))*cos({\sqrt {(}}x))/((1+cos(x))*{\sqrt {(}}x))+sin({\sqrt {(}}x))^{2}*sin(x)/(1+cos(x))^{2})/{\sqrt {(}}sin({\sqrt {(}}x))^{2}/(1+cos(x)))}$

## 偏微分

${\displaystyle f:=x^{5}*y^{6}*z^{7}}$
${\displaystyle diff(f,x)=5*x^{4}*y^{6}*z^{7}}$
${\displaystyle diff(f,y)=6*x^{5}*y^{5}*z^{7}}$
${\displaystyle diff(f,z)=7*x^{5}*y^{6}*z^{6}}$
${\displaystyle diff(f,x,y,z)=210*x^{4}*y^{5}*z^{6}}$
${\displaystyle q:=cos(x^{2})}$ *${\displaystyle exp({\sqrt {(}}y))}$ *${\displaystyle ln(tan(z))}$
${\displaystyle diff(q,x,y,z)=-sin(x^{2})*x}$ ${\displaystyle exp({\sqrt {(}}y))}$ *${\displaystyle (1+tan(z)^{2})/}$ ${\displaystyle {\sqrt {(}}y)}$ *${\displaystyle tan(z))}$

## 微分的应用

### 光在平面的反射

P 点到 x点的距离 =${\displaystyle d1={\sqrt {x^{2}+a^{2}}}}$

Q 点 到 x 点的距离=${\displaystyle d2={\sqrt {b^{2}+(l-x)^{2}}}}$

${\displaystyle D={\sqrt {x^{2}+a^{2}}}+{\sqrt {b^{2}+(l-x)^{2}}}}$

${\displaystyle D'={\frac {x}{\sqrt {x^{2}+a^{2}}}}}$ ${\displaystyle +{\frac {-l+x}{\sqrt {b^{2}+(l-x)^{2}}}}=0}$

${\displaystyle {\frac {x}{\sqrt {x^{2}+a^{2}}}}=\sin \theta _{1}}$

${\displaystyle {\frac {-l+x}{\sqrt {b^{2}+(l-x)^{2}}}}=-\sin \theta _{2}}$

${\displaystyle \sin \theta _{1}-\sin \theta _{2}=0}$
${\displaystyle \theta _{1}=\theta _{2}}$

## 光的球面反射

 光線從點Q傳播至點O時，會被半圓形鏡子反射，最終抵達點P。 R=5 半圆镜的反射点在圆的顶点，光程最长=2.82R

${\displaystyle y^{2}=R^{2}-x^{2}}$ ;

${\displaystyle D={\sqrt {2*R^{2}+2*x*R}}+{\sqrt {-2*x*R+2*R^{2}}}}$

${\displaystyle D'={\frac {R}{\sqrt {2*R^{2}+2*x*R}}}-{\frac {R}{\sqrt {-2*x*R+2*R^{2}}}}=0}$

solve(D'，x);

${\displaystyle x=0}$