Search code examples
wolfram-mathematica

Unable to simplify these two equations


I have these two equations:

pl1 = ((2*α + 1)^2/((2*α + 1)^2 - (1 - α)^2))
      (3/(2 α + 1) (xmed1 - (1 - α)/(2 α + 1) xmed2) +
      ((-3 α)/(2*α + 1) (1 - α)/(2 α + 1)*pl3))

pl3 = (2*α + 1)^2/((2*α + 1)^2 - (1 - α)^2)
      (3/(2 α + 1) (xmed3 - (1 - α)/(2 α + 1) xmed2) +
      ((-3 α)/(2*α + 1) (1 - α)/(2 α + 1)*pl1))

parameters are α, xmed1, xmed2, xmed3.

I'm trying to plug pl1 into pl3 and solve for pl3. Basically just save myself the time of doing the algebra by hand.

I currently am not even able to set pl3 as a variable as I get as output: $RecursionLimit: Recursion depth of 1023 exceeded during evaluation of (1+2 α)^2

So now I have no idea what to do. Obviously, this is my first crack at using mathematica. Thought I would speed up tedious algebra but now I've spent the last 5 hours going through tutorials and reading the documentation for mathematica... Probably should have just done it by hand!


Solution

  • Note the double equals == for solving.

    FullSimplify[Solve[
    
      {pl1 == ((2*α + 1)^2/((2*α + 1)^2 - (1 - α)^2))
              (3/(2 α + 1) (xmed1 - (1 - α)/(2 α + 1) xmed2) +
              ((-3 α)/(2*α + 1) (1 - α)/(2 α + 1)*pl3)),
    
       pl3 == (2*α + 1)^2/((2*α + 1)^2 - (1 - α)^2)
              (3/(2 α + 1) (xmed3 - (1 - α)/(2 α + 1) xmed2) +
              ((-3 α)/(2*α + 1) (1 - α)/(2 α + 1)*pl1))},
    
      {pl1, pl3}]]
    

    enter image description here