Education: hints to manual integration

105 views
Skip to first unread message

mmarco

unread,
Aug 19, 2019, 7:24:10 AM8/19/19
to sage-devel
I have been working a bit on some functions to help students do integration by hands. Under the hood, they use sympy's integral_steps function (see [1]), but I am not sure which is the right way to present it. The options I am considering are:

1) Go full step-by-step integrations, in the spirit of sympygamma site (or  wolframalpha, if you have access to the pro version). In that case, I guess returning a text (or html) stringwould be the sensible choice.

2) Just show a hint for the next step to the student, something like:

sage: integration_hint(sin(x)*x, x)
Integrate by parts, with u=x, dv=sin(x)dx. So integral(sin(x)*x, x) = x*cos(x)-integral(cos(x),x)

In this case, maybe we should return a specific class where the student can get the expression to follow the computation by hand. Also, we could have different display methods for different envirments (mainly, command line and jupyter notebook)

So my questions are:

- Which option do you think would be preferable? Show the full step by step solution, or just give hints as they are asked for?
- In any case, which would be the right way to handle different representations deppending on the environments? I assume that if we have a specific class for this, it should have some __repr__, __latex__, and __pretty_print__
- Which would be the right place to put this code? I would say sage.symbolic.integral, but some time ago someone mentioned the posibility to create an education module, to put the different pieces of code that was writen with for educational purposes.

Thierry

unread,
Aug 19, 2019, 8:30:11 AM8/19/19
to sage-...@googlegroups.com
Hi,

On Mon, Aug 19, 2019 at 04:24:10AM -0700, mmarco wrote:
> I have been working a bit on some functions to help students do integration
> by hands. Under the hood, they use sympy's integral_steps function (see
> [1]), but I am not sure which is the right way to present it. The options I
> am considering are:
>
> 1) Go full step-by-step integrations, in the spirit of sympygamma site (or
> wolframalpha, if you have access to the pro version). In that case, I guess
> returning a text (or html) stringwould be the sensible choice.
>
> 2) Just show a hint for the next step to the student, something like:
>
> sage: integration_hint(sin(x)*x, x)
> Integrate by parts, with u=x, dv=sin(x)dx. So integral(sin(x)*x, x) = x*cos(
> x)-integral(cos(x),x)
>
> In this case, maybe we should return a specific class where the student can
> get the expression to follow the computation by hand. Also, we could have
> different display methods for different envirments (mainly, command line
> and jupyter notebook)
>
> So my questions are:
>
> - Which option do you think would be preferable? Show the full step by step
> solution, or just give hints as they are asked for?

If both are ready, why not having an option "step_by_step" or
"hint_only" (or whatever convenient).

Also, notice that "integration_hint" will break the tab completion of
integrate, so maybe it could be better to propose an option "hint=False"
to the existing integrate generic function (to be discussed, i do not
have strong opinion on that).

Ciao,
Thierry


> - In any case, which would be the right way to handle different
> representations deppending on the environments? I assume that if we have a
> specific class for this, it should have some __repr__, __latex__, and
> __pretty_print__
> - Which would be the right place to put this code? I would say
> sage.symbolic.integral, but some time ago someone mentioned the posibility
> to create an education module, to put the different pieces of code that was
> writen with for educational purposes.
>
> What do you think?
>
>
>
>
> [1] https://docs.sympy.org/0.7.5/modules/integrals/integrals.htm
>
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/5a2555f3-30f9-4253-b318-d93ab8468dfc%40googlegroups.com.

rjf

unread,
Aug 19, 2019, 11:44:33 PM8/19/19
to sage-devel
It may be a mistake to combine "help for students learning symbolic integration"
and "symbolic integration" simply because the methods taught to students
are probably different from the integration algorithms used by computer algebra
systems. Certainly Maxima.  Probably sympy too, which uses various Risch heuristic
methods.


The link below to docs did not work for me until I added an "l'   to make it html.

If you are doing nothing more than putting an interface to the already
existing sympy  integral_steps, then the comment above and below pertains to
the integral_steps program, and not your interface design :). 

In fact the most useful "help" may be to 
(a) determine the calculus textbook in use 
(b) identify the assigned problem as appearing at the end of chapter X. 
(c) explain the use of the method of chapter X  (and not a later
chapter, since that is not yet allowed, and the grader may take off points
from the homework because it is clear that the student did not do
the problem him/her self.)

RJF

mmarco

unread,
Aug 20, 2019, 4:48:48 AM8/20/19
to sage-devel

The link below to docs did not work for me until I added an "l'   to make it html.

You are right, sorry for the broken link.

mmarco

unread,
Aug 20, 2019, 7:19:04 AM8/20/19
to sage-devel
BTW


El martes, 20 de agosto de 2019, 5:44:33 (UTC+2), rjf escribió:
It may be a mistake to combine "help for students learning symbolic integration"
and "symbolic integration" simply because the methods taught to students
are probably different from the integration algorithms used by computer algebra
systems. Certainly Maxima.  Probably sympy too, which uses various Risch heuristic
methods.


The standard sympy integration dos indeed use techniques that may differ a  lot from what a student would use by hand. However, sympy also has a module called manualintegrate, that tries to follow the usual techniques taught to students to integrate by hand: rewrite the integrand, change of variables, integration by parts... (and only if those fail, fallback to more powerful methods). I have run it over a battery of examples taken from a first year calculus course, and the result really follows the steps that one would expect from a student in a reasonably high precentage of the cases. You can test it in https://www.sympygamma.com for example by 

mmarco

unread,
Aug 28, 2019, 5:58:54 AM8/28/19
to sage-devel
Reply all
Reply to author
Forward
0 new messages