# Question:Sorting through multiple solutions

## Question:Sorting through multiple solutions

My students are sometimes asked to use Maple commands that give multiple answers (solve and dsolve, most commonly) and then are asked to select a certain solution out of those returned. E.G. dsolve(diff(y(x),x) = 1/2*(6*x^3+2*sin(8*x)^2)/(y(x)^2)); returns 1 real solution and 2 complex solutions. The students are asked to select the real solution and assign it to a variable. I have making sure that Maple will select the correct solution out of the set (or list or sequence) for me by using complicated if statements. E.G. The first part of the if statement I use for the dsolve() command above is if evalf[50](subs({x=1,_C1=1},Re(rhs(solsde[1])))) =evalf[50](subs({x=1,_C1=1},rhs(solsde[1]))) then real_solution:=rhs(solsde[1]); fi; I leave off the two elif parts after the first if ... then for the sake of brevity. Is there a better way that I can do this? I would imagine that Maple would have a more compact form for determining an answer of the correct form in a list/set/sequence of answers; not just complex vs real, but also positive versus negative, or within a certain range or not. Any help would be appreciated.
﻿