from sympy import *
init_printing()
x = symbols('x')
f = sin(x)*cos(x)**3
f
fs = f.series(x,0,15)
f0 = fs.removeO()
f0
plot(f,f0,(x,0,pi/2))
<sympy.plotting.plot.Plot at 0x10f4a2780>
g = integrate(f,(x,0,x))
plot(f,g,(x,0,2*pi))
<sympy.plotting.plot.Plot at 0x10fe8f1d0>
from sympy import *
init_printing()
y = symbols('y')
x = symbols('x',positive = True)
f = sqrt(x**2-Rational(1/2)*y**2)
f
int1 = integrate(f,(y,0,x))
int1
integrate(int1, (x,0,1))
A=Matrix([[1,1,1],[1,-1,-3],[0,1,2]])
A
A.rank()
x1=Matrix([1,1,0])
x2=Matrix([1,0,-1])
x3=Matrix([0,-1,1])
y1=x1
a1=y1/y1.norm()
a1
y2=x2-(x2.T*a1)[0]*a1
x2
x2a = (x2.T*a1)[0]*a1
x2a
y2 = x2-x2a
y2
a2=y2/y2.norm()
a2
x3a1 = (x3.T*a1)[0]*a1
x3a1
x3a2 = (x3.T*a2)[0]*a2
x3a2
y3=x3-x3a1-x3a2
y3
a3 = y3/y3.norm()
a3
a3.T*a1
from sympy import *
init_printing()
a, x = symbols('a x')
C1 = Rational(1/2)*x**2 + Rational(1/2)
C1
C2 = Rational(1/4)*x**2
C2
S = expand(integrate(C1-C2,(x,a,a+1)))
S
S0 = solve(diff(S,a),a)[0]
S0
S.subs({a:S0})
solve(C1-1,x)
solve(C2-1,x)
#from sympy.plotting import plot
import matplotlib.pyplot as plt
import numpy as np
plot(C1,C2,1,(x,0,3))
<sympy.plotting.plot.Plot at 0x10bcd9c18>
Su = expand(integrate(C1-1,(x,1,a+1)))
Su
S-Su
plot(S-Su,(a,0,2))
<sympy.plotting.plot.Plot at 0x115755ef0>
solve(diff(S-Su,a),a)
from sympy import *
init_printing()
a, x = symbols('a x')
C1 = Rational(1/2)*x**2 + Rational(1/2)
C1
C2 = 0.1*x**2
C2
S = expand(integrate(C1-C2,(x,a,a+1)))
S
S0 = solve(diff(S,a),a)[0]
S0
S.subs({a:S0})
solve(C1-1,x)
s1 = solve(C2-1,x)
s1[1]
#from sympy.plotting import plot
import matplotlib.pyplot as plt
import numpy as np
plot(C1,C2,1,(x,0,4))
<sympy.plotting.plot.Plot at 0x115e7c908>
Su = expand(integrate(C1-1,(x,1,a+1)))
Su
S-Su
plot(S-Su,(a,0,4))
<sympy.plotting.plot.Plot at 0x115ea4208>
solve(diff(S-Su,a),a)