# Symbolic integration has 3 solutions based on integration variable range, how to extract one of these?

1 vue (au cours des 30 derniers jours)
Jason Oakley le 17 Fév 2024
Commenté : Jason Oakley le 17 Fév 2024
r is the integration variable. The integration is:
and the result is:
size(mom_2) = 1 1
Question: how do I access each of these three possible solutions?
For example, I would like to use (50/49)*pi*U_0^2 in further calculations. Thanks ahead of time!
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponse acceptée

Paul le 17 Fév 2024
mom_2 =
One approach that just extracts the case you want
c = children(mom_2)
c = 3×2 cell array
case1 = c{1,1}
case1 =
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Jason Oakley le 17 Fév 2024
Awesome response, and so quick too!

Connectez-vous pour commenter.

### Plus de réponses (1)

John D'Errico le 17 Fév 2024
Or do this:
mom_2 =
ans =
Note that it resolves the three cases into 1.
##### 5 commentairesAfficher 3 commentaires plus anciensMasquer 3 commentaires plus anciens
Paul le 17 Fév 2024
It's usually better to use assume before calling int to give it some help. In this case, if R>0, we'd try
mom_2 =
Not sure why that didn't work. Instead, we can do
syms rho
assume(rho,'positive')
mom_2 =
mom_2 =
Jason Oakley le 17 Fév 2024
Yes, that is a good tip and now this looks like the cleanest solution

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Solvers dans Help Center et File Exchange

R2023b

### Community Treasure Hunt

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

Start Hunting!

Translated by