Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168742
Image: ubuntu2004
H(x) = 1/2*(psi(1-x/2)-psi(1/2-x/2))/gamma(1-x)
log(H(x))
log(-1/2*(psi(-1/2*x + 1/2) - psi(-1/2*x + 1))/gamma(-x + 1))
diff(log(H(x)),x,2)
-1/2*(2*(psi(-1/2*x + 1/2) - psi(-1/2*x + 1))*psi(-x + 1)/gamma(-x + 1) - (psi(1, -1/2*x + 1/2) - psi(1, -1/2*x + 1))/gamma(-x + 1))*gamma(-x + 1)*psi(-x + 1)/(psi(-1/2*x + 1/2) - psi(-1/2*x + 1)) + 1/4*(psi(1, -1/2*x + 1/2) - psi(1, -1/2*x + 1))*(2*(psi(-1/2*x + 1/2) - psi(-1/2*x + 1))*psi(-x + 1)/gamma(-x + 1) - (psi(1, -1/2*x + 1/2) - psi(1, -1/2*x + 1))/gamma(-x + 1))*gamma(-x + 1)/(psi(-1/2*x + 1/2) - psi(-1/2*x + 1))^2 + 1/4*(4*(psi(-1/2*x + 1/2) - psi(-1/2*x + 1))*psi(-x + 1)^2/gamma(-x + 1) - 4*(psi(1, -1/2*x + 1/2) - psi(1, -1/2*x + 1))*psi(-x + 1)/gamma(-x + 1) - 4*(psi(-1/2*x + 1/2) - psi(-1/2*x + 1))*psi(1, -x + 1)/gamma(-x + 1) + (psi(2, -1/2*x + 1/2) - psi(2, -1/2*x + 1))/gamma(-x + 1))*gamma(-x + 1)/(psi(-1/2*x + 1/2) - psi(-1/2*x + 1))
plot(H(x),(x,1,2))
p1=plot(gamma(x),(x,.25,4)); p2=plot(H(x),(x,-3,4), rgbcolor='green'); p=p1+p2; p.show()
H1(x) = diff(H,x,1)
H2(x) = diff(H,x,2)
p1=plot(H(x), (x,1,2)); p2=plot(H1(x),(x,1,2),rgbcolor='red'); p3=plot(H2(x),(x,1,2),rgbcolor='green'); p=p1+p2+p3; p.show()
LH(x) = log(H(x))
dLH(x) = diff(LH,x,1)
p1=plot(LH(x), (x,-5,10)); p2=plot(dLH(x),(x,-5,10),rgbcolor='red'); p=p1+p2; p.show()
p1=plot(log(x+1), (x,-1,100)); p2=plot(dLH(x), (x,-1,100), rgbcolor='green'); p=p1+p2; p.show()
p1=plot(LH(x),(x,-3,5)); p2=plot(1/12*(x-3/2)^3, (x,-3,5),rgbcolor='red'); p=p1+p2; p.show()
p1=plot(LH(x), (x,-10,10)); p2=plot(dLH(x),(x,-10,10),rgbcolor='red'); p=p1+p2; p.show()
plot(dLH(x),(x,1,2),rgbcolor='red');
x=var('x') find_root(dLH(x)==0,1.2,1.4)
1.2703764753501168
x=var('x') find_root(dLH(x)==0,1.8,1.9)
1.8375003327884909
n(LH(1.2703764753501168))
0.0149231702132196
n(LH(1.5))
0.00727650815941884
n(LH(1.8375003327884909))
-0.00856680957335963
plot(LH(x),(x,1,2))
x=var('x') find_root(H1(x),1/2,3/2)
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_21.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("eD12YXIoJ3gnKQpmaW5kX3Jvb3QoSDEoeCksMS8yLDMvMik="),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmpv2Nj4C/___code___.py", line 4, in <module> exec compile(u'find_root(H1(x),_sage_const_1 /_sage_const_2 ,_sage_const_3 /_sage_const_2 )' + '\n', '', 'single') File "", line 1, in <module> NameError: name 'H1' is not defined
x=var('x') find_root(H1(x),3/2,5/2)
1.8375003327884789
plot(H1(x), (x,1,2))
d2LH=diff(LH(x),x,2)
p1=plot(LH(x), (x,-2,10)); p2=plot(dLH(x),(x,-2,40),rgbcolor='red'); p3=plot(d2LH(x),(x,-2,40),rgbcolor='green'); p=p1+p2+p3; p.show()
dLH(x)
1/2*(2*(psi(-1/2*x + 1/2) - psi(-1/2*x + 1))*psi(-x + 1)/gamma(-x + 1) - (psi(1, -1/2*x + 1/2) - psi(1, -1/2*x + 1))/gamma(-x + 1))*gamma(-x + 1)/(psi(-1/2*x + 1/2) - psi(-1/2*x + 1))
plot(diff(H(x),x,3),(x,-3,5))
p1=plot(H(x), (x,-1,1)); p2=plot(H1(x),(x,-1,1),rgbcolor='red'); p3=plot(H2(x),(x,-1,1),rgbcolor='green'); p=p1+p2+p3; p.show()
F(x) = x*H(x) + 1/gamma(1-x)
diff(F(x),x,1)
-1/2*(psi(-1/2*x + 1/2) - psi(-1/2*x + 1))*x*psi(-x + 1)/gamma(-x + 1) + 1/4*(psi(1, -1/2*x + 1/2) - psi(1, -1/2*x + 1))*x/gamma(-x + 1) - 1/2*(psi(-1/2*x + 1/2) - psi(-1/2*x + 1))/gamma(-x + 1) + psi(-x + 1)/gamma(-x + 1)
n(H(6.5))
280.300208881221
n(gamma(6.5))
287.885277815044
diff(1/gamma(1-x),x,1)
psi(-x + 1)/gamma(-x + 1)
x=var('x') find_root(d2LH(x),8.1,9.5)
9.1950893711246984
plot(d2LH(x),(x,5,10),rgbcolor='green')
[1.5809660380138235,3.715227751138126,5.7414655980209677,7.7526800693048497; 3.1414677623024376,1,2,3]
Traceback (most recent call last): File "<stdin>", line 1, in <module> File "_sage_input_50.py", line 10, in <module> exec compile(u'open("___code___.py","w").write("# -*- coding: utf-8 -*-\\n" + _support_.preparse_worksheet_cell(base64.b64decode("WzEuNTgwOTY2MDM4MDEzODIzNSwzLjcxNTIyNzc1MTEzODEyNiw1Ljc0MTQ2NTU5ODAyMDk2NzcsNy43NTI2ODAwNjkzMDQ4NDk3OyAzLjE0MTQ2Nzc2MjMwMjQzNzYsMSwyLDNd"),globals())+"\\n"); execfile(os.path.abspath("___code___.py"))' + '\n', '', 'single') File "", line 1, in <module> File "/tmp/tmprq5skb/___code___.py", line 3 [_sage_const_1p5809660380138235 ,_sage_const_3p715227751138126 ,_sage_const_5p7414655980209677 ,_sage_const_7p7526800693048497 ; _sage_const_3p1414677623024376 ,_sage_const_1 ,_sage_const_2 ,_sage_const_3 ] ^ SyntaxError: invalid syntax