Unable to find analytical solution to integral

16 ビュー (過去 30 日間)
Lucas Giering
Lucas Giering 2015 年 12 月 21 日
コメント済み: Walter Roberson 2016 年 1 月 4 日
I am trying to solve a symbolic definite integral. I know that there has to be a solution (at least an approximate one). However, MATLAB seems to be unable to find an analytical solution of the integrals. It only returns the int(..., x=...) expression that i plug in. The only help i found in the documentation was to use taylor expansion on the function before the integration, which seems to be too much of an approximation.
Am I doing something wrong? Is there any other way to find a solution to the integral or at least a good approximation?
My code for one of the integrations:
syms a b c d E f g x y
func = a+f*x+g*y*d*(y-c)/((y-c)^2+(x-b)^2)^(1/2);
int(func(x,E),x,-E,E)

採用された回答

Walter Roberson
Walter Roberson 2015 年 12 月 24 日
syms a b c d E f g x y
func = a+f*x+g*y*d*(y-c)/((y-c)^2+(x-b)^2)^(1/2);
int(func,x,-E,E)
I do not know whether the Symbolic Toolbox is able to find the integral; it is
g*y*d*(-y+c)*(ln(-E-b+sqrt(E^2+2*E*b+b^2+(-y+c)^2)) - ln(E-b+sqrt(E^2-2*E*b+b^2+(-y+c)^2))) + 2*E*A
  3 件のコメント
Walter Roberson
Walter Roberson 2016 年 1 月 4 日
I used Maple.

サインインしてコメントする。

その他の回答 (1 件)

Rebecca Krosnick
Rebecca Krosnick 2015 年 12 月 23 日
You are not doing anything wrong. "int" just is not able to compute a closed form of the integral in this case. It is possible a closed form does not exist. To approximate the definite integral numerically, the documentation page suggests using "vpa":
Also, if you create the integration object and then later have numeric values to plug in for the variables, you can substitute in those numeric values and the integration object will update. As you fill in values for the variables the integration should become closed form. For example, if you start with the following definitions:
>> syms a b c d E f g x y;
>> func(x,y) = a+f*x+g*y*d*(y-c)/((y-c)^2+(x-b)^2)^(1/2);
>> integr = int(func(x,E),x,-E,E)
integr =
int(a + f*x + (E*d*g*(E - c))/((E - c)^2 + (b - x)^2)^(1/2), x, -E, E)
and then update "b" to be 2
>> integr = subs(integr, b, sym(2)) % substitute 2 for b in integr
integr =
int(a + f*x + (E*d*g*(E - c))/((x - 2)^2 + (E - c)^2)^(1/2), x, -E, E)
and "c" to be 3
>> integr = subs(integr, c, sym(3))
integr =
2*E*a - 3*E*d*g*(asinh((E - 2)/((E - 3)^2)^(1/2)) + asinh((E + 2)/((E - 3)^2)^(1/2))) + E^2*d*g*(asinh((E - 2)/((E - 3)^2)^(1/2)) + asinh((E + 2)/((E - 3)^2)^(1/2)))
"integr" now is in closed form.
  1 件のコメント
Lucas Giering
Lucas Giering 2016 年 1 月 4 日
Thanks for your reply, I will definitely give this a try!

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by