EDIT: In general, the square root does *not* simplify. On Monday, January 23, 2023 at 7:22:01 PM UTC+2 Kalevi Suominen wrote:
> The derivative should actually be squared in the square root expression: > sqrt(1 + f'(x)^2) (see e.g. > https://en.wikipedia.org/wiki/Surface_of_revolution), which then > simplifies to a rational function (x^6 + 1)/(2*x^3) (unless I made a > mistake). > Hence the integrand will be rational and SymPy should be able to handle it. > > In general, the square root does simplify. In that case the result will be > a hyperelliptic integral, which is non-elementary and cannot be > represented by means of common special functions. There is no support in > SymPy for such integrals. > > Kalevi Suominen > On Saturday, January 21, 2023 at 4:32:16 PM UTC+2 Oscar wrote: > >> On Sunday, 15 January 2023 at 07:36:14 UTC zaqhie...@gmail.com wrote: >> Hi all, >> >> I have a question: why SymPy (in JULIA and PYthon) unable to get the >> numerical answer for area of surface of revolution? >> >> Is it impossible? >> >> This is my question posted today on Julia Discourse: >> >> >> https://discourse.julialang.org/t/area-of-surface-of-revolution-integral-too-hard-to-be-computed-by-julia-sympy-and-python-sympy/92981 >> >> Please ask questions here rather than posting a link to somewhere else. >> >> You can numerically evaluate integrals using evalf: >> >> In [*1*]: x = symbols("x") >> >> ...: >> >> ...: f = (x**6 + 2)/(8*x**2) >> >> ...: g = sqrt(1 + diff(f,x)) >> >> ...: >> >> ...: h = 2*pi*Integral(((x**6 + 2)/(8*x**2))*sqrt(1 + diff(f,x)), (x, >> 1, 3)) >> >> >> In [*2*]: h >> >> Out[*2*]: >> >> 3 >> >> ⌠ >> >> ⎮ ___________________ >> >> ⎮ ╱ 3 6 >> >> ⎮ ⎛ 6 ⎞ ╱ 3⋅x x + 2 >> >> ⎮ ⎝x + 2⎠⋅ ╱ ──── + 1 - ────── >> >> ⎮ ╱ 4 3 >> >> ⎮ ╲╱ 4⋅x >> >> 2⋅π⋅⎮ ────────────────────────────────── dx >> >> ⎮ 2 >> >> ⎮ 8⋅x >> >> ⌡ >> >> 1 >> >> >> In [*3*]: h.evalf() >> Out[*3*]: 116.281297293490 >> >> >> >> -- >> Oscar >> > -- You received this message because you are subscribed to the Google Groups "sympy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sympy+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/97fc1690-5552-45af-9d37-e437481d3c71n%40googlegroups.com.