yacas icon indicating copy to clipboard operation
yacas copied to clipboard

Integrate an expression with a parameter?

Open doronbehar opened this issue 3 years ago • 1 comments

Why does this not work:

In> Integrate(x) 1/(x^2+a^2)
CommandLine(1) : "Gcd: argument is not an exact number"
Out> False

Do I need to declare a? Derivation for such an expression does work:

In> D(x) 1/(x^2+a^2)
Out> (-2*x)/(x^2+a^2)^2

doronbehar avatar Nov 29 '21 09:11 doronbehar

Hi,

1/(x^2 + a^2) is a very simple rational function, which integrates to 1/a * arctan(x/a) + c for non-zero, real a. The problem is that it's treated as a general rational function, where presence of parameter(s) makes things quite difficult. The error you get is from the general algorithm for integrating rational functions. I'll try to add some code to integrate well known special cases like this before the general method is attempted.

grzegorzmazur avatar Nov 30 '21 11:11 grzegorzmazur