Use a variable obtained from a "Solve" in another equation?

Hey everyone,

I have been having trouble to plug in a variable and assign its value automatically. Normally I would have to plug it manually but I want my program to run automatically even when I change initial conditions.
Here it is an example:

  • Simplify[Solve[E^5 + E^-5 == Subscript[C, 1] + Subscript[C, 2],
    Subscript[C, 1]]]
  • Simplify[Solve[e^5 + e^(-5) == C1 +C2, C1]
    I want to solve for C1 and then plug that value in another equation but I do not know how to do it automatically.

See if this is what you want to do:

r1 = Subscript[C, 1] /. 
  Simplify[Solve[E^5 + E^-5 == Subscript[C, 1] + Subscript[C, 2], 
     Subscript[C, 1]]][[1]]

c1.png

r2 = C1 /. Simplify[Solve[e^5 + e^(-5) == C1 + C2, C1]][[1]]

c2.png

-r1 - r2

c3.png

I could do it in just one equation but I chose to do it in two parts so you can see the procedure. Did this help?

You can also do:

n = Simplify[
    Solve[E^5 + E^-5 == Subscript[C, 1] + Subscript[C, 2], 
     Subscript[C, 1]]][[1]];

r1 = Lookup[Association@n, Subscript[C, 1]]

c1.png

Yes! Thats exactly what I have boon looking for. Thank you very much!