How do I solve this equation in MatLab?

1 vue (au cours des 30 derniers jours)
Isaac Hewitt
Isaac Hewitt le 24 Juin 2021
Commenté : Walter Roberson le 24 Juin 2021
Find the area of the region bounded by the hyperbola 9x^2−4y^2=36 and the line x=3.
I cannot find out the proper way to input this into MatLab. It requires trig substitution so I believe the problem stems from there but I am new to MatLab and don't know what I can do to fix it.
Here is my code:
>> syms x
>> EQ = 3*sqrt(x^2-4)
EQ =
3*(x^2 - 4)^(1/2)
>> A = int(EQ,2,3)
A =
log(161 - 72*5^(1/2)) + (9*5^(1/2))/2
>>
Here is the actual answer to the problem:
(9/2)*sqrt(5) - 6*ln((3 + sqrt(5))/2)

Réponse acceptée

KSSV
KSSV le 24 Juin 2021
Why worry the final answer is same right?
syms x
eq = 3*sqrt(x^2-4) ;
A1 = int(eq,2,3) ;
A2 = (9/2)*sqrt(5) - 6*log((3 + sqrt(5))/2) ;
[double(A1) A2]
ans = 1×2
4.2878 4.2878
  4 commentaires
Isaac Hewitt
Isaac Hewitt le 24 Juin 2021
Modifié(e) : Isaac Hewitt le 24 Juin 2021
What does that mean? I just downloaded MatLab for a class a few days ago, I have no idea what that means.
I ask this because in all my calculations
log(161 - 72*5^(1/2)) + (9*5^(1/2))/2 = 7.55445
(9/2)*sqrt(5) - 6*ln((3 + sqrt(5))/2) = 4.28776
Walter Roberson
Walter Roberson le 24 Juin 2021
format long g
syms x
eq = 3*sqrt(x^2-4)
eq = 
A1 = int(eq,2,3)
A1 = 
A2 = (9/2)*sqrt(5) - 6*log((3 + sqrt(5))/2)
A2 =
4.28776399803381
simplify(A1 - A2)
ans = 
double(A1 - A2)
ans =
2.3429264568019e-16
log(161 - 72*5^(1/2)) + (9*5^(1/2))/2
ans =
4.28776399803129
.... not 7.55445

Connectez-vous pour commenter.

Plus de réponses (0)

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by