---
author: Nathan Carter (ncarter@bentley.edu)
---

This answer assumes you have imported SymPy as follows.


```python
from sympy import *                   # load all math functions
init_printing( use_latex='mathjax' )  # use pretty math output
```

Let's choose an example formula whose antiderivative we will compute.


```python
var( 'x' )
formula = 3*sqrt(x)
formula
```




$\displaystyle 3 \sqrt{x}$



Use the `Integral` function to build a definite integral without evaluating it.
The second parameter is the variable with respect to which you're integrating.


```python
Integral( formula, x )
```




$\displaystyle \int 3 \sqrt{x}\, dx$



Use the `integrate` function to perform the integration, showing the answer.


```python
integrate( formula, x )
```




$\displaystyle 2 x^{\frac{3}{2}}$




```python
integrate( formula, x ) + var('C')  # same, but with a constant of integration
```




$\displaystyle C + 2 x^{\frac{3}{2}}$



abbb2df6fb646077cfefb833dee09a5ad3561d37
ipynb
Jupyter Notebook
database/tasks/How to write and evaluate indefinite integrals/Python, using SymPy.ipynb
nathancarter/how2data
7d4f2838661f7ce98deb1b8081470cec5671b03a
MIT
database/tasks/How to write and evaluate indefinite integrals/Python, using SymPy.ipynb
nathancarter/how2data
7d4f2838661f7ce98deb1b8081470cec5671b03a
MIT
database/tasks/How to write and evaluate indefinite integrals/Python, using SymPy.ipynb
nathancarter/how2data
7d4f2838661f7ce98deb1b8081470cec5671b03a
MIT
2021-07-18T19:01:29.000Z
2022-03-29T06:47:11.000Z
Qwen/Qwen-72B
1. YES
2. YES