本文整理汇总了Python中sympy.acoth函数的典型用法代码示例。如果您正苦于以下问题:Python acoth函数的具体用法?Python acoth怎么用?Python acoth使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了acoth函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_issue_10847
def test_issue_10847():
assert manualintegrate(x**2 / (x**2 - c), x) == c*Piecewise((atan(x/sqrt(-c))/sqrt(-c), -c > 0), \
(-acoth(x/sqrt(c))/sqrt(c), And(-c < 0, x**2 > c)), \
(-atanh(x/sqrt(c))/sqrt(c), And(-c < 0, x**2 < c))) + x
assert manualintegrate(sqrt(x - y) * log(z / x), x) == 4*y**2*Piecewise((atan(sqrt(x - y)/sqrt(y))/sqrt(y), y > 0), \
(-acoth(sqrt(x - y)/sqrt(-y))/sqrt(-y), \
And(x - y > -y, y < 0)), \
(-atanh(sqrt(x - y)/sqrt(-y))/sqrt(-y), \
And(x - y < -y, y < 0)))/3 \
- 4*y*sqrt(x - y)/3 + 2*(x - y)**(S(3)/2)*log(z/x)/3 \
+ 4*(x - y)**(S(3)/2)/9
assert manualintegrate(sqrt(x) * log(x), x) == 2*x**(S(3)/2)*log(x)/3 - 4*x**(S(3)/2)/9
assert manualintegrate(sqrt(a*x + b) / x, x) == -2*b*Piecewise((-atan(sqrt(a*x + b)/sqrt(-b))/sqrt(-b), -b > 0), \
(acoth(sqrt(a*x + b)/sqrt(b))/sqrt(b), And(-b < 0, a*x + b > b)), \
(atanh(sqrt(a*x + b)/sqrt(b))/sqrt(b), And(-b < 0, a*x + b < b))) \
+ 2*sqrt(a*x + b)
assert expand(manualintegrate(sqrt(a*x + b) / (x + c), x)) == -2*a*c*Piecewise((atan(sqrt(a*x + b)/sqrt(a*c - b))/sqrt(a*c - b), \
a*c - b > 0), (-acoth(sqrt(a*x + b)/sqrt(-a*c + b))/sqrt(-a*c + b), And(a*c - b < 0, a*x + b > -a*c + b)), \
(-atanh(sqrt(a*x + b)/sqrt(-a*c + b))/sqrt(-a*c + b), And(a*c - b < 0, a*x + b < -a*c + b))) \
+ 2*b*Piecewise((atan(sqrt(a*x + b)/sqrt(a*c - b))/sqrt(a*c - b), a*c - b > 0), \
(-acoth(sqrt(a*x + b)/sqrt(-a*c + b))/sqrt(-a*c + b), And(a*c - b < 0, a*x + b > -a*c + b)), \
(-atanh(sqrt(a*x + b)/sqrt(-a*c + b))/sqrt(-a*c + b), And(a*c - b < 0, a*x + b < -a*c + b))) + 2*sqrt(a*x + b)
assert manualintegrate((4*x**4 + 4*x**3 + 16*x**2 + 12*x + 8) \
/ (x**6 + 2*x**5 + 3*x**4 + 4*x**3 + 3*x**2 + 2*x + 1), x) == \
2*x/(x**2 + 1) + 3*atan(x) - 1/(x**2 + 1) - 3/(x + 1)
assert manualintegrate(sqrt(2*x + 3) / (x + 1), x) == 2*sqrt(2*x + 3) - log(sqrt(2*x + 3) + 1) + log(sqrt(2*x + 3) - 1)
assert manualintegrate(sqrt(2*x + 3) / 2 * x, x) == (2*x + 3)**(S(5)/2)/20 - (2*x + 3)**(S(3)/2)/4
assert manualintegrate(x**Rational(3,2) * log(x), x) == 2*x**Rational(5,2)*log(x)/5 - 4*x**Rational(5,2)/25
assert manualintegrate(x**(-3) * log(x), x) == -log(x)/(2*x**2) - 1/(4*x**2)
assert manualintegrate(log(y)/(y**2*(1 - 1/y)), y) == \
log(y)*log(-1 + 1/y) - Integral(log(-1 + 1/y)/y, y)
示例2: _expr_big
def _expr_big(cls, x, n):
from sympy import acoth, sqrt, pi, I
if n.is_even:
return (acoth(sqrt(x)) + I * pi / 2) / sqrt(x)
else:
return (acoth(sqrt(x)) - I * pi / 2) / sqrt(x)
示例3: test_messy
def test_messy():
from sympy import (laplace_transform, Si, Shi, Chi, atan, Piecewise,
acoth, E1, besselj, acosh, asin, And, re,
fourier_transform, sqrt)
assert laplace_transform(Si(x), x, s) == ((-atan(s) + pi/2)/s, 0, True)
assert laplace_transform(Shi(x), x, s) == (acoth(s)/s, 1, True)
# where should the logs be simplified?
assert laplace_transform(Chi(x), x, s) == \
((log(s**(-2)) - log((s**2 - 1)/s**2))/(2*s), 1, True)
# TODO maybe simplify the inequalities?
assert laplace_transform(besselj(a, x), x, s)[1:] == \
(0, And(S(0) < re(a/2) + S(1)/2, S(0) < re(a/2) + 1))
# NOTE s < 0 can be done, but argument reduction is not good enough yet
assert fourier_transform(besselj(1, x)/x, x, s, noconds=False) == \
(Piecewise((0, 4*abs(pi**2*s**2) > 1),
(2*sqrt(-4*pi**2*s**2 + 1), True)), s > 0)
# TODO FT(besselj(0,x)) - conditions are messy (but for acceptable reasons)
# - folding could be better
assert integrate(E1(x)*besselj(0, x), (x, 0, oo), meijerg=True) == \
log(1 + sqrt(2))
assert integrate(E1(x)*besselj(1, x), (x, 0, oo), meijerg=True) == \
log(S(1)/2 + sqrt(2)/2)
assert integrate(1/x/sqrt(1 - x**2), x, meijerg=True) == \
Piecewise((-acosh(1/x), 1 < abs(x**(-2))), (I*asin(1/x), True))
示例4: test_issue_6746
def test_issue_6746():
y = Symbol('y')
n = Symbol('n')
assert manualintegrate(y**x, x) == \
Piecewise((x, Eq(log(y), 0)), (y**x/log(y), True))
assert manualintegrate(y**(n*x), x) == \
Piecewise(
(x, Eq(n, 0)),
(Piecewise(
(n*x, Eq(log(y), 0)),
(y**(n*x)/log(y), True))/n, True))
assert manualintegrate(exp(n*x), x) == \
Piecewise((x, Eq(n, 0)), (exp(n*x)/n, True))
y = Symbol('y', positive=True)
assert manualintegrate((y + 1)**x, x) == (y + 1)**x/log(y + 1)
y = Symbol('y', zero=True)
assert manualintegrate((y + 1)**x, x) == x
y = Symbol('y')
n = Symbol('n', nonzero=True)
assert manualintegrate(y**(n*x), x) == \
Piecewise((n*x, Eq(log(y), 0)), (y**(n*x)/log(y), True))/n
y = Symbol('y', positive=True)
assert manualintegrate((y + 1)**(n*x), x) == \
(y + 1)**(n*x)/(n*log(y + 1))
a = Symbol('a', negative=True)
assert manualintegrate(1 / (a + b*x**2), x) == \
Piecewise((atan(x/sqrt(a/b))/(b*sqrt(a/b)), a/b > 0), \
(-acoth(x/sqrt(-a/b))/(b*sqrt(-a/b)), And(a/b < 0, x**2 > -a/b)), \
(-atanh(x/sqrt(-a/b))/(b*sqrt(-a/b)), And(a/b < 0, x**2 < -a/b)))
示例5: test_acot
def test_acot():
assert acot(nan) == nan
assert acot(-oo) == 0
assert acot(oo) == 0
assert acot(1) == pi/4
assert acot(0) == pi/2
assert acot(sqrt(3)/3) == pi/3
assert acot(1/sqrt(3)) == pi/3
assert acot(-1/sqrt(3)) == -pi/3
assert acot(x).diff(x) == -1/(1 + x**2)
assert acot(r).is_real is True
assert acot(I*pi) == -I*acoth(pi)
assert acot(-2*I) == I*acoth(2)
示例6: test_hyperbolic
def test_hyperbolic():
x = Symbol("x")
assert sinh(x).nseries(x, 0, 6) == x + x**3/6 + x**5/120 + O(x**6)
assert cosh(x).nseries(x, 0, 5) == 1 + x**2/2 + x**4/24 + O(x**5)
assert tanh(x).nseries(x, 0, 6) == x - x**3/3 + 2*x**5/15 + O(x**6)
assert coth(x).nseries(x, 0, 6) == 1/x - x**3/45 + x/3 + 2*x**5/945 + O(x**6)
assert asinh(x).nseries(x, 0, 6) == x - x**3/6 + 3*x**5/40 + O(x**6)
assert acosh(x).nseries(x, 0, 6) == pi*I/2 - I*x - 3*I*x**5/40 - I*x**3/6 + O(x**6)
assert atanh(x).nseries(x, 0, 6) == x + x**3/3 + x**5/5 + O(x**6)
assert acoth(x).nseries(x, 0, 6) == x + x**3/3 + x**5/5 + pi*I/2 + O(x**6)
示例7: test_derivs
def test_derivs():
x = Symbol('x')
assert coth(x).diff(x) == -sinh(x)**(-2)
assert sinh(x).diff(x) == cosh(x)
assert cosh(x).diff(x) == sinh(x)
assert tanh(x).diff(x) == -tanh(x)**2 + 1
assert acoth(x).diff(x) == 1/(-x**2 + 1)
assert asinh(x).diff(x) == 1/sqrt(x**2 + 1)
assert acosh(x).diff(x) == 1/sqrt(x**2 - 1)
assert atanh(x).diff(x) == 1/(-x**2 + 1)
示例8: test_inverses
def test_inverses():
x = Symbol('x')
assert sinh(x).inverse() == asinh
raises(AttributeError, lambda: cosh(x).inverse())
assert tanh(x).inverse() == atanh
assert coth(x).inverse() == acoth
assert asinh(x).inverse() == sinh
assert acosh(x).inverse() == cosh
assert atanh(x).inverse() == tanh
assert acoth(x).inverse() == coth
示例9: test_conv12b
def test_conv12b():
x = sympy.Symbol("x")
y = sympy.Symbol("y")
assert sympify(sympy.sinh(x/3)) == sinh(Symbol("x") / 3)
assert sympify(sympy.cosh(x/3)) == cosh(Symbol("x") / 3)
assert sympify(sympy.tanh(x/3)) == tanh(Symbol("x") / 3)
assert sympify(sympy.coth(x/3)) == coth(Symbol("x") / 3)
assert sympify(sympy.asinh(x/3)) == asinh(Symbol("x") / 3)
assert sympify(sympy.acosh(x/3)) == acosh(Symbol("x") / 3)
assert sympify(sympy.atanh(x/3)) == atanh(Symbol("x") / 3)
assert sympify(sympy.acoth(x/3)) == acoth(Symbol("x") / 3)
示例10: test_acot
def test_acot():
assert acot(nan) == nan
assert acot.nargs == FiniteSet(1)
assert acot(-oo) == 0
assert acot(oo) == 0
assert acot(1) == pi/4
assert acot(0) == pi/2
assert acot(sqrt(3)/3) == pi/3
assert acot(1/sqrt(3)) == pi/3
assert acot(-1/sqrt(3)) == -pi/3
assert acot(x).diff(x) == -1/(1 + x**2)
assert acot(r).is_real is True
assert acot(I*pi) == -I*acoth(pi)
assert acot(-2*I) == I*acoth(2)
assert acot(x).is_positive is None
assert acot(r).is_positive is True
assert acot(p).is_positive is True
assert acot(I).is_positive is False
示例11: test_simplifications
def test_simplifications():
x = Symbol('x')
assert sinh(asinh(x)) == x
assert sinh(acosh(x)) == sqrt(x-1) * sqrt(x+1)
assert sinh(atanh(x)) == x/sqrt(1-x**2)
assert sinh(acoth(x)) == 1/(sqrt(x-1) * sqrt(x+1))
assert cosh(asinh(x)) == sqrt(1+x**2)
assert cosh(acosh(x)) == x
assert cosh(atanh(x)) == 1/sqrt(1-x**2)
assert cosh(acoth(x)) == x/(sqrt(x-1) * sqrt(x+1))
assert tanh(asinh(x)) == x/sqrt(1+x**2)
assert tanh(acosh(x)) == sqrt(x-1) * sqrt(x+1) / x
assert tanh(atanh(x)) == x
assert tanh(acoth(x)) == 1/x
assert coth(asinh(x)) == sqrt(1+x**2)/x
assert coth(acosh(x)) == x/(sqrt(x-1) * sqrt(x+1))
assert coth(atanh(x)) == 1/x
assert coth(acoth(x)) == x
示例12: test_leading_term
def test_leading_term():
x = Symbol('x')
assert cosh(x).as_leading_term(x) == 1
assert coth(x).as_leading_term(x) == 1/x
assert acosh(x).as_leading_term(x) == I*pi/2
assert acoth(x).as_leading_term(x) == I*pi/2
for func in [sinh, tanh, asinh, atanh]:
assert func(x).as_leading_term(x) == x
for func in [sinh, cosh, tanh, coth, asinh, acosh, atanh, acoth]:
for arg in (1/x, S.Half):
eq = func(arg)
assert eq.as_leading_term(x) == eq
示例13: test_derivs
def test_derivs():
x = Symbol('x')
assert coth(x).diff(x) == -sinh(x)**(-2)
assert sinh(x).diff(x) == cosh(x)
assert cosh(x).diff(x) == sinh(x)
assert tanh(x).diff(x) == -tanh(x)**2 + 1
assert csch(x).diff(x) == -coth(x)*csch(x)
assert sech(x).diff(x) == -tanh(x)*sech(x)
assert acoth(x).diff(x) == 1/(-x**2 + 1)
assert asinh(x).diff(x) == 1/sqrt(x**2 + 1)
assert acosh(x).diff(x) == 1/sqrt(x**2 - 1)
assert atanh(x).diff(x) == 1/(-x**2 + 1)
assert asech(x).diff(x) == -1/(x*sqrt(1 - x**2))
assert acsch(x).diff(x) == -1/(x**2*sqrt(1 + x**(-2)))
示例14: test_conv12
def test_conv12():
x = Symbol("x")
y = Symbol("y")
assert sinh(x/3) == sinh(sympy.Symbol("x") / 3)
assert cosh(x/3) == cosh(sympy.Symbol("x") / 3)
assert tanh(x/3) == tanh(sympy.Symbol("x") / 3)
assert coth(x/3) == coth(sympy.Symbol("x") / 3)
assert asinh(x/3) == asinh(sympy.Symbol("x") / 3)
assert acosh(x/3) == acosh(sympy.Symbol("x") / 3)
assert atanh(x/3) == atanh(sympy.Symbol("x") / 3)
assert acoth(x/3) == acoth(sympy.Symbol("x") / 3)
assert sinh(x/3)._sympy_() == sympy.sinh(sympy.Symbol("x") / 3)
assert cosh(x/3)._sympy_() == sympy.cosh(sympy.Symbol("x") / 3)
assert tanh(x/3)._sympy_() == sympy.tanh(sympy.Symbol("x") / 3)
assert coth(x/3)._sympy_() == sympy.coth(sympy.Symbol("x") / 3)
assert asinh(x/3)._sympy_() == sympy.asinh(sympy.Symbol("x") / 3)
assert acosh(x/3)._sympy_() == sympy.acosh(sympy.Symbol("x") / 3)
assert atanh(x/3)._sympy_() == sympy.atanh(sympy.Symbol("x") / 3)
assert acoth(x/3)._sympy_() == sympy.acoth(sympy.Symbol("x") / 3)
示例15: test_issue_6746
def test_issue_6746():
y = Symbol('y')
n = Symbol('n')
assert manualintegrate(y**x, x) == Piecewise(
(y**x/log(y), Ne(log(y), 0)), (x, True))
assert manualintegrate(y**(n*x), x) == Piecewise(
(Piecewise(
(y**(n*x)/log(y), Ne(log(y), 0)),
(n*x, True)
)/n, Ne(n, 0)),
(x, True))
assert manualintegrate(exp(n*x), x) == Piecewise(
(exp(n*x)/n, Ne(n, 0)), (x, True))
y = Symbol('y', positive=True)
assert manualintegrate((y + 1)**x, x) == (y + 1)**x/log(y + 1)
y = Symbol('y', zero=True)
assert manualintegrate((y + 1)**x, x) == x
y = Symbol('y')
n = Symbol('n', nonzero=True)
assert manualintegrate(y**(n*x), x) == Piecewise(
(y**(n*x)/log(y), Ne(log(y), 0)), (n*x, True))/n
y = Symbol('y', positive=True)
assert manualintegrate((y + 1)**(n*x), x) == \
(y + 1)**(n*x)/(n*log(y + 1))
a = Symbol('a', negative=True)
b = Symbol('b')
assert manualintegrate(1/(a + b*x**2), x) == \
Piecewise((atan(x/sqrt(a/b))/(b*sqrt(a/b)), a/b > 0), \
(-acoth(x/sqrt(-a/b))/(b*sqrt(-a/b)), And(a/b < 0, x**2 > -a/b)), \
(-atanh(x/sqrt(-a/b))/(b*sqrt(-a/b)), And(a/b < 0, x**2 < -a/b)))
b = Symbol('b', negative=True)
assert manualintegrate(1/(a + b*x**2), x) == \
atan(x/(sqrt(-a)*sqrt(-1/b)))/(b*sqrt(-a)*sqrt(-1/b))
assert manualintegrate(1/((x**a + y**b + 4)*sqrt(a*x**2 + 1)), x) == \
y**(-b)*Integral(x**(-a)/(y**(-b)*sqrt(a*x**2 + 1) +
x**(-a)*sqrt(a*x**2 + 1) + 4*x**(-a)*y**(-b)*sqrt(a*x**2 + 1)), x)
assert manualintegrate(1/((x**2 + 4)*sqrt(4*x**2 + 1)), x) == \
Integral(1/((x**2 + 4)*sqrt(4*x**2 + 1)), x)
assert manualintegrate(1/(x - a**x + x*b**2), x) == \
Integral(1/(-a**x + b**2*x + x), x)