Re: M.U.C.
- To: mathgroup at smc.vnet.net
- Subject: [mg20627] Re: M.U.C.
- From: "David Bailey" <db at salford-software.com>
- Date: Thu, 4 Nov 1999 02:13:37 -0500
- Organization: University of Salford, Salford, Manchester, UK
- References: <7vm3io$q82@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Roscoe <roscoe at hazardcounty.org> wrote in message news:7vm3io$q82 at smc.vnet.net... > How can Mathematica solve the following Linear Operator for a and b? > (E^(-2 x)((-3) + 10 b - x + 6 a(1 + 5 x)) == 0 > > By hand it would be : > (-3+10b+6a)=0 > (-1+30a)=0 > > a=1/30 > b=whatever > > I need mathematica to group the coeeficients of x^0 and x^1, set them equal > to 0 and solve. > I am trying to avoid doing the gruoping by hand. Thanks. You can use the Coefficient function to isolate the coefficients of powers of x in a polynomial. However, your LHS is not actually a polynomial because you have a multiplier of E^(-2 x) (although it can be divided out). A simple solution is to generate two simultaneous equations with x set to two distinct values - e.g. 0 and 1. If you do that you do not need to wory about making the LHS a polynomial: eqn = (E^(-2 x)((-3) + 10 b - x + 6 a(1 + 5 x)) == 0) In[4]:= Solve[{eqn /. x -> 0, eqn /. x -> 1}, {a, b}] Out[4]= {{a->1/30,b->7/25}} David Bailey Salford Software