CoCalc Public FilesAnalýza.sagewsOpen with one click!
Author: Roman Plch
Views : 314
Compute Environment: Ubuntu 20.04 (Default)
%typeset_mode True
diff(exp(-x^2),x)
2xe(x2)\displaystyle -2 \, x e^{\left(-x^{2}\right)}
'diff(exp(-x^2),x)'
diff(exp(-x^2),x)
diff(exp(-x^2),x,2)
4x2e(x2)2e(x2)\displaystyle 4 \, x^{2} e^{\left(-x^{2}\right)} - 2 \, e^{\left(-x^{2}\right)}
diff(log(x/(x^2+1)),x)
(x2+1)(2x2(x2+1)21x2+1)x\displaystyle -\frac{{\left(x^{2} + 1\right)} {\left(\frac{2 \, x^{2}}{{\left(x^{2} + 1\right)}^{2}} - \frac{1}{x^{2} + 1}\right)}}{x}
diff(log(x/(x^2+1)),x).simplify_full()
x21x3+x\displaystyle -\frac{x^{2} - 1}{x^{3} + x}
diff(x^(x^x),x)
(xx(log(x)+1)log(x)+xxx)x(xx)\displaystyle {\left(x^{x} {\left(\log\left(x\right) + 1\right)} \log\left(x\right) + \frac{x^{x}}{x}\right)} x^{\left(x^{x}\right)}
diff(x^(x^x),x).collect(log(x))
xxx(xx)log(x)2+xxx(xx)log(x)+xxx(xx)x\displaystyle x^{x} x^{\left(x^{x}\right)} \log\left(x\right)^{2} + x^{x} x^{\left(x^{x}\right)} \log\left(x\right) + \frac{x^{x} x^{\left(x^{x}\right)}}{x}
%html Derivace funkce dané implicitně
Derivace funkce dané implicitně
reset()
var('x')
x\displaystyle x
y = function('y')(x);y
y(x)\displaystyle y\left(x\right)
dy=y.diff(x);dy
xy(x)\displaystyle \frac{\partial}{\partial x}y\left(x\right)
var('c')
c\displaystyle c
eq=x^2+y^2==c;eq
x2+y(x)2=c\displaystyle x^{2} + y\left(x\right)^{2} = c
dc=diff(eq,x);dc
2y(x)xy(x)+2x=0\displaystyle 2 \, y\left(x\right) \frac{\partial}{\partial x}y\left(x\right) + 2 \, x = 0
yx=solve(dc,dy);yx
[xy(x)=xy(x)\displaystyle \frac{\partial}{\partial x}y\left(x\right) = -\frac{x}{y\left(x\right)}]
dcc=diff(eq,x,2);dcc
2xy(x)2+2y(x)2(x)2y(x)+2=0\displaystyle 2 \, \frac{\partial}{\partial x}y\left(x\right)^{2} + 2 \, y\left(x\right) \frac{\partial^{2}}{(\partial x)^{2}}y\left(x\right) + 2 = 0
dyy=y.diff(x,2);dyy
2(x)2y(x)\displaystyle \frac{\partial^{2}}{(\partial x)^{2}}y\left(x\right)
yxx=solve(dcc,dyy);yxx
[2(x)2y(x)=xy(x)2+1y(x)\displaystyle \frac{\partial^{2}}{(\partial x)^{2}}y\left(x\right) = -\frac{\frac{\partial}{\partial x}y\left(x\right)^{2} + 1}{y\left(x\right)}]
yxx[0].rhs().subs(yx).simplify_full()
x2+y(x)2y(x)3\displaystyle -\frac{x^{2} + y\left(x\right)^{2}}{y\left(x\right)^{3}}
%html Parciální derivace
Parciální derivace
var('x,y,a')
(x\displaystyle x, y\displaystyle y, a\displaystyle a)
diff(exp(a*x*y^2),x).diff(y,2)
4a3x2y4e(axy2)+10a2xy2e(axy2)+2ae(axy2)\displaystyle 4 \, a^{3} x^{2} y^{4} e^{\left(a x y^{2}\right)} + 10 \, a^{2} x y^{2} e^{\left(a x y^{2}\right)} + 2 \, a e^{\left(a x y^{2}\right)}
diff(exp(a*x*y^2),x,1,y,2)
4a3x2y4e(axy2)+10a2xy2e(axy2)+2ae(axy2)\displaystyle 4 \, a^{3} x^{2} y^{4} e^{\left(a x y^{2}\right)} + 10 \, a^{2} x y^{2} e^{\left(a x y^{2}\right)} + 2 \, a e^{\left(a x y^{2}\right)}
diff(sin(x+y)/y^4, x,5,y,2)
cos(x+y)y4+8sin(x+y)y5+20cos(x+y)y6\displaystyle -\frac{\cos\left(x + y\right)}{y^{4}} + \frac{8 \, \sin\left(x + y\right)}{y^{5}} + \frac{20 \, \cos\left(x + y\right)}{y^{6}}
var('n')
n\displaystyle n
%html Derivace funkce (ve smyslu datové struktury v Sage)
Derivace funkce (ve smyslu datové struktury v Sage)
g(x)=x^n*exp(sin(x));g
x  xnesin(x)\displaystyle x \ {\mapsto}\ x^{n} e^{\sin\left(x\right)}
g.diff()
x  (nxn1esin(x)+xncos(x)esin(x))\displaystyle x \ {\mapsto}\ \left(n x^{n - 1} e^{\sin\left(x\right)} + x^{n} \cos\left(x\right) e^{\sin\left(x\right)}\right)
g.diff()(pi/6)
((16π)n1ne12+123(16π)ne12)\displaystyle \left(\left(\frac{1}{6} \, \pi\right)^{n - 1} n e^{\frac{1}{2}} + \frac{1}{2} \, \sqrt{3} \left(\frac{1}{6} \, \pi\right)^{n} e^{\frac{1}{2}}\right)
g.diff().diff()
(x  (n1)nxn2esin(x)+2nxn1cos(x)esin(x)+xncos(x)2esin(x)xnesin(x)sin(x))\displaystyle \left(\begin{array}{r} x \ {\mapsto}\ {\left(n - 1\right)} n x^{n - 2} e^{\sin\left(x\right)} + 2 \, n x^{n - 1} \cos\left(x\right) e^{\sin\left(x\right)} + x^{n} \cos\left(x\right)^{2} e^{\sin\left(x\right)} - x^{n} e^{\sin\left(x\right)} \sin\left(x\right) \end{array}\right)
f(x,y)=x^2*y+2*x*y+x
f.diff() #vypočte obě parciální derivace
(x,y)  (2xy+2y+1,x2+2x)\displaystyle \left( x, y \right) \ {\mapsto} \ \left(2 \, x y + 2 \, y + 1,\,x^{2} + 2 \, x\right)
f.diff(x); f.diff(y)
(x,y)  2xy+2y+1\displaystyle \left( x, y \right) \ {\mapsto} \ 2 \, x y + 2 \, y + 1
(x,y)  x2+2x\displaystyle \left( x, y \right) \ {\mapsto} \ x^{2} + 2 \, x
f.diff(x).diff(y) #smíšená parciální derivace vzhledem k x a y.
(x,y)  2x+2\displaystyle \left( x, y \right) \ {\mapsto} \ 2 \, x + 2
F=piecewise([[(-infinity,0),sin(x)],[[0,0],arctan(x)],[(0,infinity),arctan(x)]], var=x)
plot(F(x), (x,-3*pi,3*pi))
F=piecewise([[(-infinity,0),sin(x)],[[0,0],arctan(x)],[(0,infinity),arctan(x)]], var=x)
F.derivative()
(0, 0, 0)*D[0]piecewise(x|-->sin(x) on (-oo, 0), x|-->arctan(x) on {0}, x|-->arctan(x) on (0, +oo); x) + D[1]piecewise(x|-->sin(x) on (-oo, 0), x|-->arctan(x) on {0}, x|-->arctan(x) on (0, +oo); x)
i=integral(x/(x^3+1), x);i
133arctan(133(2x1))+16log(x2x+1)13log(x+1)\displaystyle \frac{1}{3} \, \sqrt{3} \arctan\left(\frac{1}{3} \, \sqrt{3} {\left(2 \, x - 1\right)}\right) + \frac{1}{6} \, \log\left(x^{2} - x + 1\right) - \frac{1}{3} \, \log\left(x + 1\right)
diff(i,x).simplify_full()
xx3+1\displaystyle \frac{x}{x^{3} + 1}
i=integral(x/(x^5+1),x);i
25arctan(4x+5125+10)525+10+25arctan(4x5125+10)525+10log(2x2x(5+1)+2)5(5+1)+log(2x2+x(51)+2)5(51)15log(x+1)\displaystyle -\frac{2 \, \sqrt{5} \arctan\left(\frac{4 \, x + \sqrt{5} - 1}{\sqrt{2 \, \sqrt{5} + 10}}\right)}{5 \, \sqrt{2 \, \sqrt{5} + 10}} + \frac{2 \, \sqrt{5} \arctan\left(\frac{4 \, x - \sqrt{5} - 1}{\sqrt{-2 \, \sqrt{5} + 10}}\right)}{5 \, \sqrt{-2 \, \sqrt{5} + 10}} - \frac{\log\left(2 \, x^{2} - x {\left(\sqrt{5} + 1\right)} + 2\right)}{5 \, {\left(\sqrt{5} + 1\right)}} + \frac{\log\left(2 \, x^{2} + x {\left(\sqrt{5} - 1\right)} + 2\right)}{5 \, {\left(\sqrt{5} - 1\right)}} - \frac{1}{5} \, \log\left(x + 1\right)
diff(i,x).simplify_full()
xx5+1\displaystyle \frac{x}{x^{5} + 1}
integral(2*x*(x^2+1)^24, x)
125(x2+1)25\displaystyle \frac{1}{25} \, {\left(x^{2} + 1\right)}^{25}
Určitý integrál
i=integral(x/(x^3+1), (x,1,2));i
1183π16log(3)+13log(2)\displaystyle \frac{1}{18} \, \sqrt{3} \pi - \frac{1}{6} \, \log\left(3\right) + \frac{1}{3} \, \log\left(2\right)
i.n()
0.350246906114333\displaystyle 0.350246906114333
numerical_integral(x/(x^3+1), 1,2)
(0.3502469061143331\displaystyle 0.3502469061143331, 3.888521794718582×1015\displaystyle 3.888521794718582 \times 10^{-15})
integral(1/x^2, (x,-1,1)
Error in lines 1-1 Traceback (most recent call last): File "/cocalc/lib/python2.7/site-packages/smc_sagews/sage_server.py", line 1188, in execute flags=compile_flags) in namespace, locals File "<string>", line 1 integral(Integer(1)/x**Integer(2), (x,-Integer(1),Integer(1)) ^ SyntaxError: unexpected EOF while parsing
plot(1/x^2, (x,-1,1), ymin=0, ymax=10)
%html Nevlastní integrál
Nevlastní integrál
var('t')
t\displaystyle t
integral(t^4*log(t)^2/(1+3*t^2)^3, t,0,oo)
15763π3+15763πlog(3)211083πlog(3)+12163π\displaystyle \frac{1}{576} \, \sqrt{3} \pi^{3} + \frac{1}{576} \, \sqrt{3} \pi \log\left(3\right)^{2} - \frac{1}{108} \, \sqrt{3} \pi \log\left(3\right) + \frac{1}{216} \, \sqrt{3} \pi
integral(exp(arcsin(x)), x,0,1)
12e(12π)12\displaystyle \frac{1}{2} \, e^{\left(\frac{1}{2} \, \pi\right)} - \frac{1}{2}
integral(sqrt(9-x^2), x)
12x2+9x+92arcsin(13x)\displaystyle \frac{1}{2} \, \sqrt{-x^{2} + 9} x + \frac{9}{2} \, \arcsin\left(\frac{1}{3} \, x\right)
Sumace
var('k,n,a,y')
(k\displaystyle k, n\displaystyle n, a\displaystyle a, y\displaystyle y)
sum(k^7, k,1,20)
3877286700\displaystyle 3877286700
sum(k^7, k,1,n)
18n8+12n7+712n6724n4+112n2\displaystyle \frac{1}{8} \, n^{8} + \frac{1}{2} \, n^{7} + \frac{7}{12} \, n^{6} - \frac{7}{24} \, n^{4} + \frac{1}{12} \, n^{2}
sum(1/(k^2-4), k,3,oo)
2548\displaystyle \frac{25}{48}
Taylorova řada
t=taylor(sin(tan(x))-tan(sin(x)), x,0,25);t
480743327105054114616431560515174400000x253746946250748836690480522485760000x2320975554600017602818775552000x2116641083631905468364800x19101932074358914560x1731114886954486432000x15957392x13191375600x1129756x9130x7\displaystyle \frac{48074332710505411}{4616431560515174400000} \, x^{25} - \frac{374694625074883}{6690480522485760000} \, x^{23} - \frac{2097555460001}{7602818775552000} \, x^{21} - \frac{1664108363}{1905468364800} \, x^{19} - \frac{10193207}{4358914560} \, x^{17} - \frac{311148869}{54486432000} \, x^{15} - \frac{95}{7392} \, x^{13} - \frac{1913}{75600} \, x^{11} - \frac{29}{756} \, x^{9} - \frac{1}{30} \, x^{7}
type(t)
<type 'sage.symbolic.expression.Expression'>
f=sin(tan(x))-tan(sin(x))
t1=f.series(x,25);t1
(130)x7+(29756)x9+(191375600)x11+(957392)x13+(31114886954486432000)x15+(101932074358914560)x17+(16641083631905468364800)x19+(20975554600017602818775552000)x21+(3746946250748836690480522485760000)x23+O(x25)\displaystyle {(-\frac{1}{30})} x^{7} + {(-\frac{29}{756})} x^{9} + {(-\frac{1913}{75600})} x^{11} + {(-\frac{95}{7392})} x^{13} + {(-\frac{311148869}{54486432000})} x^{15} + {(-\frac{10193207}{4358914560})} x^{17} + {(-\frac{1664108363}{1905468364800})} x^{19} + {(-\frac{2097555460001}{7602818775552000})} x^{21} + {(-\frac{374694625074883}{6690480522485760000})} x^{23} + \mathcal{O}\left(x^{25}\right)
type(t1)
<type 'sage.symbolic.series.SymbolicSeries'>
t1.coefficients()
[[0\displaystyle 0, 0\displaystyle 0], [0\displaystyle 0, 1\displaystyle 1], [0\displaystyle 0, 2\displaystyle 2], [0\displaystyle 0, 3\displaystyle 3], [0\displaystyle 0, 4\displaystyle 4], [0\displaystyle 0, 5\displaystyle 5], [0\displaystyle 0, 6\displaystyle 6], [130\displaystyle -\frac{1}{30}, 7\displaystyle 7], [0\displaystyle 0, 8\displaystyle 8], [29756\displaystyle -\frac{29}{756}, 9\displaystyle 9], [0\displaystyle 0, 10\displaystyle 10], [191375600\displaystyle -\frac{1913}{75600}, 11\displaystyle 11], [0\displaystyle 0, 12\displaystyle 12], [957392\displaystyle -\frac{95}{7392}, 13\displaystyle 13], [0\displaystyle 0, 14\displaystyle 14], [31114886954486432000\displaystyle -\frac{311148869}{54486432000}, 15\displaystyle 15], [0\displaystyle 0, 16\displaystyle 16], [101932074358914560\displaystyle -\frac{10193207}{4358914560}, 17\displaystyle 17], [0\displaystyle 0, 18\displaystyle 18], [16641083631905468364800\displaystyle -\frac{1664108363}{1905468364800}, 19\displaystyle 19], [0\displaystyle 0, 20\displaystyle 20], [20975554600017602818775552000\displaystyle -\frac{2097555460001}{7602818775552000}, 21\displaystyle 21], [0\displaystyle 0, 22\displaystyle 22], [3746946250748836690480522485760000\displaystyle -\frac{374694625074883}{6690480522485760000}, 23\displaystyle 23], [0\displaystyle 0, 24\displaystyle 24]]
t2=t1.truncate();t2
3746946250748836690480522485760000x2320975554600017602818775552000x2116641083631905468364800x19101932074358914560x1731114886954486432000x15957392x13191375600x1129756x9130x7\displaystyle -\frac{374694625074883}{6690480522485760000} \, x^{23} - \frac{2097555460001}{7602818775552000} \, x^{21} - \frac{1664108363}{1905468364800} \, x^{19} - \frac{10193207}{4358914560} \, x^{17} - \frac{311148869}{54486432000} \, x^{15} - \frac{95}{7392} \, x^{13} - \frac{1913}{75600} \, x^{11} - \frac{29}{756} \, x^{9} - \frac{1}{30} \, x^{7}
type(t2)
<type 'sage.symbolic.expression.Expression'>
taylor(x*y^3,(x,1),(y,-1),4)
(x1)(y+1)33(x1)(y+1)2+(y+1)3+3(x1)(y+1)3(y+1)2x+3y+3\displaystyle {\left(x - 1\right)} {\left(y + 1\right)}^{3} - 3 \, {\left(x - 1\right)} {\left(y + 1\right)}^{2} + {\left(y + 1\right)}^{3} + 3 \, {\left(x - 1\right)} {\left(y + 1\right)} - 3 \, {\left(y + 1\right)}^{2} - x + 3 \, y + 3
%html Výpočty limit
Výpočty limit
limit( cos(x)^(1/x^3), x=0)
und\displaystyle \mathit{und}
limit( cos(x)^(1/x^3), x=0, dir='plus')
0\displaystyle 0
limit( cos(x)^(1/x^3), x=0, dir='minus')
+\displaystyle +\infty
var('a,b')
(a\displaystyle a, b\displaystyle b)
y=exp(a*x)*cos(b*x);y
cos(bx)e(ax)\displaystyle \cos\left(b x\right) e^{\left(a x\right)}
assume(a>0, b>0)
limit(y, x=-oo)
0\displaystyle 0
%html Diferenciální rovnice
Diferenciální rovnice
y = function('y')(x)
ode=x*diff(y,x)==y;ode
xxy(x)=y(x)\displaystyle x \frac{\partial}{\partial x}y\left(x\right) = y\left(x\right)
sol=desolve(ode,y);expand(sol)
Cx\displaystyle C x
desolve(ode, y, ics=[1,1])
x\displaystyle x