フィルターのクリア

How to get results from symbolic variable integration

2 ビュー (過去 30 日間)
Hosup Song
Hosup Song 2016 年 7 月 27 日
コメント済み: Walter Roberson 2016 年 7 月 28 日
Pretty straight forward, I'm trying to do integration with symbolic variables.
I'm doing some complex integration with a mix of high degree polynomials and trig functions.
This is what I tried so far:
syms x
b4 = (x^127+x^32-x^12+78*x^2-5*cos(x))
int(b4, 0, 1)
I was hoping to get some number for the answer, but instead, I got this:
ans =
int((x^127+x^32-x^12+78*x^2-5*cos(x)), x, 0, 1)
I don't know why this is happening. How do I get the actual answer in numbers?

採用された回答

Walter Roberson
Walter Roberson 2016 年 7 月 27 日
There is no readily-found closed-form solution for your actual integral. You will need to use vpa() or double() to request numeric integration.
  2 件のコメント
Hosup Song
Hosup Song 2016 年 7 月 28 日
so would i have to do something like
b4 = (((1+x^3+x^i)^(1/2))*((1/0.00149912)*(cos(x)-30*(6-11*sin(1)+...
6*cos(1))*x^2+(192-336*sin(1)+168*cos(1))*x-36+57*sin(1)-24*cos(1))))
A = int(b4, 0, 1)
double(A)
Would this give me a numeral value for the answer?
Walter Roberson
Walter Roberson 2016 年 7 月 28 日
Yes, it would give you a numeric value for the integral.

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

その他の回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2016 年 7 月 27 日
in R2016a
>> syms x
b4 = (x^127+x^32-x^12+78*x^2-5*cos(x));
int(b4, 0, 1)
ans =
1425581/54912 - 5*sin(1)
>>
  1 件のコメント
Hosup Song
Hosup Song 2016 年 7 月 27 日
編集済み: Walter Roberson 2016 年 7 月 27 日
ok i guess that was a bad example to use, since it works out nicely. The actual function I'm using is
b4 = (((1+x^3+x^i)^(1/2))*((1/0.00149912)*(cos(x)-30*(6-11*sin(1)+...
6*cos(1))*x^2+(192-336*sin(1)+168*cos(1))*x-36+57*sin(1)-24*cos(1))))
I'm trying to integrate this and when I use int(b4, 0, 1), i get ans =
int((x^3 + x^1i + 1)^(1/2)*((1885688952269973342506590723*x)/77371252455336267181195264 + (5867504283985271*cos(x))/8796093022208 + (1423673755532221964006035379175*x^2)/4951760157141521099596496896 - 1657186126350190416636264063127/2475880078570760549798248448), x, 0, 1)
How do i get rid of this.

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

カテゴリ

Help Center および File ExchangeAssumptions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by