New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integral that should have closed form is not evaluating #13608
Comments
|
I get this on master for that general form: In [3]: A, B, C = symbols('A B C')
In [4]: integrate(t / (A*t**2 + B*t + C), t)
Out[4]:
⎛ ⎛ _____________ ⎞ ⎛ _____________ ⎞ ⎞
⎜ ⎜ ╱ 2 ⎟ ⎜ ╱ 2 ⎟ ⎟
⎜ ⎜ B⋅╲╱ -4⋅A⋅C + B 1 ⎟ 2 ⎜ B⋅╲╱ -4⋅A⋅C + B 1 ⎟ ⎟
⎛ _____________ ⎞ ⎜ - 4⋅A⋅C⋅⎜- ────────────────── + ───⎟ + B ⋅⎜- ────────────────── + ───⎟ + 2⋅C⎟ ⎛ _____
⎜ ╱ 2 ⎟ ⎜ ⎜ ⎛ 2⎞ 2⋅A⎟ ⎜ ⎛ 2⎞ 2⋅A⎟ ⎟ ⎜ ╱
⎜ B⋅╲╱ -4⋅A⋅C + B 1 ⎟ ⎜ ⎝ 2⋅A⋅⎝4⋅A⋅C - B ⎠ ⎠ ⎝ 2⋅A⋅⎝4⋅A⋅C - B ⎠ ⎠ ⎟ ⎜B⋅╲╱ -4⋅A
⎜- ────────────────── + ───⎟⋅log⎜t + ────────────────────────────────────────────────────────────────────────────⎟ + ⎜──────────
⎜ ⎛ 2⎞ 2⋅A⎟ ⎝ B ⎠ ⎜ ⎛
⎝ 2⋅A⋅⎝4⋅A⋅C - B ⎠ ⎠ ⎝ 2⋅A⋅⎝4⋅A⋅
⎛ ⎛ _____________ ⎞ ⎛ _____________ ⎞ ⎞
⎜ ⎜ ╱ 2 ⎟ ⎜ ╱ 2 ⎟ ⎟
⎜ ⎜B⋅╲╱ -4⋅A⋅C + B 1 ⎟ 2 ⎜B⋅╲╱ -4⋅A⋅C + B 1 ⎟ ⎟
________ ⎞ ⎜ - 4⋅A⋅C⋅⎜────────────────── + ───⎟ + B ⋅⎜────────────────── + ───⎟ + 2⋅C⎟
2 ⎟ ⎜ ⎜ ⎛ 2⎞ 2⋅A⎟ ⎜ ⎛ 2⎞ 2⋅A⎟ ⎟
⋅C + B 1 ⎟ ⎜ ⎝ 2⋅A⋅⎝4⋅A⋅C - B ⎠ ⎠ ⎝ 2⋅A⋅⎝4⋅A⋅C - B ⎠ ⎠ ⎟
──────── + ───⎟⋅log⎜t + ────────────────────────────────────────────────────────────────────────⎟
2⎞ 2⋅A⎟ ⎝ B ⎠
C - B ⎠ ⎠
Probably a simpler output is possible if you say what A, B and C should be. Is this still an issue or should I close it? |
I get the same. And |
It's possible that @jacluff1 had a particular combination of coefficients that caused trouble. We should allow time to respond. I'm going to create a label "could-close" for this situation - after some time if there is no response it can be closed. |
I think that there is currently no support for completing the square in |
Good point @jksuom :) I missed off the square root: In [31]: A, B, C = symbols('A B C')
In [32]: integrate(t / sqrt(A*t**2 + B*t + C), t)
Out[32]:
⌠
⎮ t
⎮ ─────────────────── dt
⎮ ________________
⎮ ╱ 2
⎮ ╲╱ A⋅t + B⋅t + C
⌡ With In [33]: integrate(t / sqrt(A*t**2 + C), t)
Out[33]:
⎧ __________
⎪ ╱ 2
⎪╲╱ A⋅t + C
⎪───────────── for A ≠ 0
⎪ A
⎨
⎪ 2
⎪ t
⎪ ──── otherwise
⎪ 2⋅√C
⎩ So I guess the issue is adding support for completing the square inside the square root. |
I have an integral of the form:
t / sy.sqrt( At**2 + Bt + C ),
where:
t = sy.symbols('t', real=True, positive=True)
A,B,C = sy.symbols('A B C', real=True)
when I try to integrate in sympy, it does not evaluate; when I integrate in wolfram alpha, it does. I am writing code in Jupyter Notebook at http://localhost:8888/notebooks/meeting3.ipynb
The text was updated successfully, but these errors were encountered: