1

I was trying to sove this equation to obtain b as a function of a, but I do not understand the answer that Mathematica gives to me. What are the solts # for? and the &,1 in the end?

Equation

Flatten[Solve[((3 a + 5 b)^2 (6 a + 11 b) (6 a^2 + 13 a b + 9 b^2))/(
   1296 (a + b)^3 (2 a + b)^2) == 1, b, Reals]]

Solution:

{b -> Root[-4860 a^5 - 18360 a^4 #1 - 25407 a^3 #1^2 - 
     14223 a^2 #1^3 - 1177 a #1^4 + 1179 #1^5 &, 1]}

Thank you very much!

2 Answers2

0

Assuming a!=0 you can transform your equation

eq=((3 a + 5 b)^2 (6 a + 11 b) (6 a^2 + 13 a b +9 b^2))/(1296 (a + b)^3 (2 a + b)^2) == 1 /. b -> \[Alpha] a //FullSimplify[#, a > 0] &
(*((3 + 5 \[Alpha])^2 (6 +11 \[Alpha]) (6 + \[Alpha] (13 + 9 \[Alpha])))/(1296 (1 + \[Alpha])^3 (2 + \[Alpha])^2) == 1*)

with the new parameter \[Alpha]=b/a.

Solve[eq, \[Alpha]] // N 
(*{{\[Alpha] ->4.69952}, 
{\[Alpha] -> -0.996298 -0.440207 I},
{\[Alpha] -> -0.996298 +0.440207 I}, 
{\[Alpha] -> -0.854309 -0.0974171 I},
{\[Alpha] -> -0.854309 + 0.0974171 I}}*)
Ulrich Neumann
  • 53,729
  • 2
  • 23
  • 55
0

Mathematica allows one to write a function on the fly without giving it a name (similar to lambda in Lisp). Say for example that we want to square an argument. There are two ways of writing it on the fly

Function[x, x^2][2]
(* 4 *)

Another way is using slots and ampersand

#^2 &[2]
(* 4 *)

The root object you see is using the second syntax.

sol = 
 Solve[((3 a + 5 b)^2 (6 a + 11 b) (6 a^2 + 13 a b + 
        9 b^2))/(1296 (a + b)^3 (2 a + b)^2) == 1, b, Reals]
(* {{b -> 
   Root[-4860 a^5 - 18360 a^4 #1 - 25407 a^3 #1^2 - 14223 a^2 #1^3 - 
      1177 a #1^4 + 1179 #1^5 &, 1]}} *)

You can evaluate it numerically by replacing a with a number applying N

You can extract the function from the variable sol using Part as follows

sol[[1]]
(* {b -> 
  Root[-4860 a^5 - 18360 a^4 #1 - 25407 a^3 #1^2 - 14223 a^2 #1^3 - 
     1177 a #1^4 + 1179 #1^5 &, 1]} *)

sol[[1, 1, 2]]
(* Root[-4860 a^5 - 18360 a^4 #1 - 25407 a^3 #1^2 - 
   14223 a^2 #1^3 - 1177 a #1^4 + 1179 #1^5 &, 1] *)

Now try use ReplaceAll

N[sol[[1, 1, 2]] /. a -> 1 ]
(* 4.69952 *)
Jack LaVigne
  • 14,462
  • 2
  • 25
  • 37