Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I need to find all variables $A, B, C, D$ for given equation with independent variable $s$.
How can I solve that with Mathematica ?
Example, not working: enter image description here



enter image description here


enter image description here


enter image description here


enter image description here

Nothing of listed above gives the result I need.


I need denominators below $A,B,C,D$ to be predefined (not what Apart offers). $A,B,C,D$ must be numbers (don't include variable).


migration rejected from math.stackexchange.com Mar 11 '14 at 0:56

This question came from our site for people studying math at any level and professionals in related fields. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as unclear what you're asking by Sjoerd C. de Vries, bobthechemist, The Toad Mar 11 '14 at 0:56

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

Multiply the last expression in FOUR by (5 + s)/(5 + s) and add it the third term. –  Alan Mar 9 '14 at 20:17
Be careful, both C and D have built in meanings. –  Jacob Akkerboom Mar 10 '14 at 9:10
A few of your Solve examples don't obey the correct syntax for Solve. Also don't expect a solution for four variables if you only have two equations. –  Sjoerd C. de Vries Mar 10 '14 at 12:39

1 Answer 1

up vote 3 down vote accepted

You could also to match coefficients:

 Equal @@ 
  PadRight @
    {CoefficientList[Numerator[(-s^2 + 40 s + 50)/(s (s + 1) (s + 5)^2)], s], 
     CoefficientList[Numerator @ Together[a/s + b/(s + 1) + (c*s + d)/(s + 5)^2], s]},
 {a, b, c, d}]
  {{a -> 2, b -> -(9/16), c -> -(23/16), d -> -(255/16)}}
I was wondering why you need to PadRight, I do not see the logic with the need for the last zero? –  ALEXANDER Jan 2 at 17:10
@ALEXANDER You need the two coefficient lists to have the same length so that the equation Equal @@... has the same number of components on each side. PadRight does that. Basically, in this particular case, it's setting the coefficient of the highest degree term on the right a + b + c equal to zero (degree 3). –  Michael E2 Jan 2 at 17:18
Thank you for ur feedback, that makes sense! –  ALEXANDER Jan 2 at 21:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.