Symbolic expressions in Sage tend to be computed to some extent.
Sometimes we can hold off this computation with a "hold" keyword.
The integrate
function, in particular, does support that keyword.
Example.
Sage and Python versions used for this example:
sage: print("{}, Python {}.{}.{}".format(version(), *sys.version_info[:3]))
SageMath version 9.8, Release Date: 2023-02-11, Python 3.10.8
Define a symbolic variable:
sage: z = SR.var('z')
The integral is computed before being latexed...
sage: latex(integrate(z^4, z))
\frac{1}{5} \, z^{5}
... unless we hold off the computation:
sage: latex(integrate(z^4, z, hold=True))
\int z^{4}\,{d z}
We can use an equation with both forms:
sage: latex(integrate(z^4, z, hold=True) == integrate(z^4, z))
\int z^{4}\,{d z} = \frac{1}{5} \, z^{5}
Or, giving the held integral a name:
sage: a = integrate(z^4, z, hold=True)
sage: a
integrate(z^4, z)
sage: a.unhold()
1/5*z^5
sage: latex(a == a.unhold())
\int z^{4}\,{d z} = \frac{1}{5} \, z^{5}
Welcome to Ask Sage! Thank you for your question!