Opened 3 years ago

# Step by step integration for educational use — at Version 2

Reported by: Owned by: mmarco major sage-9.7 symbolics integration, education, sd110 nthiery, kcrisman, slelievre Miguel Marco N/A u/mmarco/manualintegrate 9824f80aee60f09d2e6faeaf30b3a7640c77107a

This branch implements a system to compute symbolic integrals step by step, trying to follow the rules that are taught to students to compute integrals by hand.

To compute the appropriate rules, it uses the sympy module `manualintegrate`.

It is exposed to the user through a `ManualIntegral` class, that can either be iterated to get hints on steps to follow:

```sage: from sage.symbolic.integration.manual import ManualIntegral
sage: M = ManualIntegral(exp(x)*sin(x), x)
sage: M.hint()
(u == sin(x),
dv == e^x,
du == cos(x),
v == integrate(e^x, x),
integrate(e^x*sin(x), x) == v*sin(x) - integrate(v*cos(x), x))
sage: M.hint()
(integrate(e^x, x) == e^x,)
sage: M.hint()
(u == cos(x),
dv == e^x,
du == -sin(x),
v == integrate(e^x, x),
integrate(cos(x)*e^x, x) == v*cos(x) - integrate(-v*sin(x), x))
sage: M.hint()
(integrate(e^x, x) == e^x,)
sage: M.hint()
(integrate(e^x*sin(x), x) == -cos(x)*e^x + e^x*sin(x) - integrate(e^x*sin(x), x),
2*integrate(e^x*sin(x), x) == -cos(x)*e^x + e^x*sin(x))
```

Also, all hints can be listed at once:

```sage: M.all_hints()
[(u == sin(x),
dv == e^x,
du == cos(x),
v == integrate(e^x, x),
integrate(e^x*sin(x), x) == v*sin(x) - integrate(v*cos(x), x)),
(integrate(e^x, x) == e^x,),
(u == cos(x),
dv == e^x,
du == -sin(x),
v == integrate(e^x, x),
integrate(cos(x)*e^x, x) == v*cos(x) - integrate(-v*sin(x), x)),
(integrate(e^x, x) == e^x,),
(integrate(e^x*sin(x), x) == -cos(x)*e^x + e^x*sin(x) - integrate(e^x*sin(x), x),
2*integrate(e^x*sin(x), x) == -cos(x)*e^x + e^x*sin(x))]
```

### comment:1 Changed 3 years ago by mmarco

• Branch set to u/mmarco/manualintegrate

### comment:2 Changed 3 years ago by mmarco

• Authors set to Miguel Marco
• Commit set to 9824f80aee60f09d2e6faeaf30b3a7640c77107a
• Component changed from PLEASE CHANGE to symbolics
• Description modified (diff)
 ​6cd0e60 `First implementation` ​9824f80 `Complete docstrings and tests.`