You should already be able to do this with the Prime. Use partial fraction decomposition and then integrate afterward.
He wants a single button to magically switch between all possible representations. Probably also knowing which of all of them is the desired one.
TIM, an idea would be store each level of history in a kind internal file.
for example tinspire stores each level, the outgoing messages or warnings, in hpprime are lost, only the output is displayed in the terminal window at the time of the execution, to explore the history you can not recover out messages =(.
On Texas Instruments calculator, exploring the history, each level displays the output messages on a status line, it may be good idea to copy this feature on the hpprime
1 (IN): cSolve((x^4-4*x^3+2*x^2+4*x+4) = 0) EXACT MODE ON [ENTER]
1 (OUT):{2.52409830901+0.568221484575*i,−0.524098309012-0.568221484575*i,2.52409830901-0.568221484575*i,−0.524098309012+0.568221484575*i}
status line - > "WARNING, CONVERTING TO APPROXIMATTE SQRT "