Nspire CAS and Partial Fractions

6,534 views
Skip to first unread message

Nevil Hopley

unread,
Jun 27, 2010, 8:34:12 AM6/27/10
to tinspire
I'm wanting to know if it's possible to have Nspire CAS 'compare
coefficients' of polynomial expressions, as one does when manually
deriving partial fractions for example.

An example:
Consider splitting (x^2+3)/(x(1+x^2)) into partial fractions

I already know that to get Nspire CAS to turn this into partial
fractions in a single step you can type in:
expand((x^2+3)/(x(1+x^2)))

If I did it manually on paper, I would start off by:
(x^2+3)/(x(1+x^2)) = A/x + (Bx+C)/(1+x^2)

Then, by combining fractions on the RHS, I'd then compare the
polynomial coefficients of the numerators on both sides, and come up
with A=3, B=-2 and C=0

It's this process of taking the statement (x^2+3)/(x(1+x^2)) = A/x +
(Bx+C)/(1+x^2) and concluding the values of A, B and C that I am
interested in finding out if the Nspire can help process.

Any takers for this challenge?

One condition I'd like to uphold - the method of using Nspire for this
must not be long and convoluted and requiring umpteen steps to employ
for each term of polynomial term comparisons! Am I asking for too
much?

Thank you!

Nevil Hopley
www.CalculatorSoftware.co.uk

Nelson Sousa

unread,
Jun 27, 2010, 10:07:28 AM6/27/10
to tins...@googlegroups.com


Yes, it can be done (although not entirely on an automatic fashion without entering the realm of really complex stuff).

1. Comdenom - returns the expression in fraction form;
2. Getnum - returns the numerator of a faction;
3. Polycoeffs - returns the list of coefficients of a polynomial with respect to a certain variable;
4. Solve - this one is self-explanatory.


So, just create a function that accepts an equation such as that one and the number of variables and define:

Func
:Local lhslist,rhslist,eqstr,varlist,i,str
:polyCoeffs(getNum(comDenom(left(expression))),x)→lhslist
:polyCoeffs(getNum(comDenom(right(expression))),x)→rhslist
:{}→varlist
:""→eqstr
:For i,1,n
:  expr(char(96+i))→varlist[i]
:  eqstr&string(lhslist[i])&"="&string(rhslist[i])&" and "→eqstr
:EndFor
:left(eqstr,dim(eqstr)-5)→eqstr
:"solve("&eqstr&","&string(varlist)&")"→str
:Return expr(str)
:EndFunc


Cheers,
Nelson



--
To post to this group, send email to tins...@googlegroups.com
To unsubscribe send email to tinspire+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com.au/group/tinspire?hl=en-GB?hl=en-GB
The tns documents shared by group members are archived at
http://lafacroft.com/archive/nspire.php

Luke Setzer

unread,
Oct 17, 2013, 12:13:33 PM10/17/13
to tins...@googlegroups.com, nso...@gmail.com
Was anyone able to get Nelson's proposed function to work in a public Library file?

Samuel Hollis

unread,
Mar 9, 2016, 5:48:43 AM3/9/16
to tinspire, nso...@gmail.com
Yea, I was.  Probably too late of a reply
Reply all
Reply to author
Forward
0 new messages