I am trying to find the solution to this indefinite integral but when I try the symbolic method I get an error saying 'a' is an undefined variable. Can anyone help me out?

 Respuesta aceptada

Star Strider
Star Strider el 18 de Abr. de 2016
The solution is to define ‘a’:
syms x a
e = int(sqrt((x - a)/(x + a)), x);
e = simplify(e, 'steps', 10)
e =
(a + x)*(-(a - x)/(a + x))^(1/2) - 2*a*atanh((-(a - x)/(a + x))^(1/2))

Más respuestas (1)

Torsten
Torsten el 18 de Abr. de 2016
syms a x
int(sqrt((x-a)/(x+a)),x)
does not work ?
Best wishes
Torsten.

3 comentarios

Derek Bindbeutel
Derek Bindbeutel el 18 de Abr. de 2016
I already tried that and unfortunately no. Here is the error I got with that method
Error using inlineeval (line 14) Error in inline expression ==> sqrt((x-a)/(x+a)) Undefined function or variable 'a'. Error in inline/subsref (line 23) INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr, INLINE_OBJ_.expr);
Torsten
Torsten el 18 de Abr. de 2016
Then you don't seem to use the most recent MATLAB version.
Take a look at your documentation for suitable examples.
Best wishes
Torsten.
Steven Lord
Steven Lord el 18 de Abr. de 2016
You defined the expression to be integrated as an inline object. That won't work. Define it as a symbolic expression instead as Star Strider and Torsten did; note that this will require Symbolic Math Toolbox.

Iniciar sesión para comentar.

Preguntada:

el 18 de Abr. de 2016

Comentada:

el 18 de Abr. de 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by