In [1]:
using SymPy
In [3]:
x=symbols("x",real=true)
Out[3]:
In [4]:
integrate(1/(x+sqrt(x^2+6*x+10)),x)
Out[4]:
In [5]:
integrate(1/(x-3+sqrt(1+x^2)))
Out[5]:
In [6]:
I₁=1/(x-3+sqrt(1+x^2))
Out[6]:
In [7]:
z=symbols("z",real=true)
Out[7]:
In [8]:
I₂=subs(I₁,x,(1-z^2)/(2*z))
Out[8]:
In [9]:
simplify(I₂)
Out[9]:
In [10]:
I₂=subs(I₁,sqrt(x^2+1),x+z)
Out[10]:
In [11]:
I₃=subs(I₂,x,(1-z^2)/(2*z))
Out[11]:
In [12]:
# Množi s dx
I₄=I₃*(-1)*(1+z^2)/(2*z^2)
Out[12]:
In [13]:
I₄=simplify(I₄)
Out[13]:
In [14]:
I₅=integrate(I₄,z)
Out[14]:
In [15]:
# Vratimo supstitucije
I₆=subs(I₅,(1-z^2)/(2*z),x)
Out[15]:
In [16]:
I₆=subs(I₅,z,-x+sqrt(x^2+1))
Out[16]:
In [17]:
# Primjer 1.12
integrate(x^2*sqrt(4*x^2+9))
Out[17]:
In [20]:
# Primjer 1.13
I₇=((3*x-x*x*x)^(1//3))
Out[20]:
In [21]:
integrate(I₇,x)
Out[21]:
In [22]:
s₁=series(exp(x),x)
Out[22]:
In [23]:
s₂=series(exp(x),x,0,10)
Out[23]:
Razvoj u red funkcije $f(x)=e^{-x^2}$
In [24]:
s₃=subs(s₂,x,(-x^2))
Out[24]:
In [25]:
s₄=integrate(s₃,x)
Out[25]:
In [28]:
# Uklonimo član O(x^21)
s₆=s₄.removeO()
Out[28]:
In [30]:
# Izračunajmo vrijednost u točki x=0.1
subs(s₆,x,0.1)
Out[30]:
In [31]:
# Maclaurin-ov red za sin(x)
s₁=series(sin(x),x,0,10)
Out[31]:
In [33]:
# Razvoj u red za sin(x)/x
s₂=simplify(s₁/x)
Out[33]:
In [34]:
# Ukonimo O() clan
s₃=s₂.removeO()
Out[34]:
In [35]:
# Integrirajmo
s₄=integrate(s₃,x)
Out[35]:
In [ ]: