CoCalc Shared FilesDifferentiabilite.sagews
Author: Juan Carlos Bustamante
Views : 37

Différentiabilité

Exemple 1

On considère la fonction $f(x,y) = x^{1/3}y^{1/3}$.

• On calucle ses dérivées partielles
• Son plan tangent.
cmsel = [colormaps['autumn'](i) for i in sxrange(0,1,0.05)] f(x,y)=x^(1/3)*y^(1/3) S=plot3d(f,(x,0.00001,2),(y,0.001,2), adaptive=True, color=cmsel) Plan=plot3d(0,(x,0,2),(y,0,2), color='brown', opacity=0.45) show(S + Plan) C= contour_plot(f, (x,0.00001, 2), (y,0.0001, 2),cmap='autumn',linestyles='solid', fill=False) show(C,figsize=4)
3D rendering not yet implemented

Exemple 2

On considère cette fois la fonction $f(x,) = \left| |x|-|y| \right| - |x| - |y|$, et on s'intéresse à ce qui se passe près de l'origine.

cmsel = [colormaps['Greens'](i) for i in sxrange(0.3,0.9,0.05)] f(x,y)=abs(abs(x)-abs(y)) - abs(x)-abs(y) S=plot3d(f,(x,-2,2),(y,-2,2), adaptive=True, color=cmsel, mesh = 1) Plan=plot3d(0,(x,-2,2),(y,-2,2), color='brown', opacity=0.45) show(S) C= contour_plot(f, (x,-1.5, 1.5), (y,-1.5, 1.5),cmap='Greys',linestyles='solid', fill=True, colorbar = True) show(C,figsize=4)
3D rendering not yet implemented

Exemple

Cette fois une fonction différentiable. On trace la surface ainsi que son plan tangent.

cmsel = [colormaps['autumn'](i) for i in sxrange(0,1,0.05)] f(x,y)=x^2+x*y+3*y^2 T=taylor(f(x,y),(x,1),(y,1),1) S=plot3d(f,(x,0,3),(y,0,3), adaptive=True, color=cmsel) Plan=plot3d(T,(x,0,3),(y,0,3), color='blue',opacity=0.65) show(S+Plan, frame_aspect_ratio = [15,15,1]) C= contour_plot(f, (x,0.5, 1.5), (y,0.5, 1.5),cmap='autumn',linestyles='solid', fill=False) show(C,figsize=4)
3D rendering not yet implemented

On remarque que les courbes de niveau ressemblent à des droites.