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.

How do I evaluate a conditional expression in order to convert the solutions that are in terms of $x$ to a new variable $c$ depending on $x$? The conventional method I have been using with eliminate doesn't work in this case, because the solution is not a simple inequality, but rather conditional.

 f[x_] := x^2 + c;
 g[x_] := f[f[x]];
 y = Solve[g'[x] == 1, x, Reals]

output is:

{{x -> ConditionalExpression[Root[-1 + 4 c #1 + 4 #1^3 &, 1], 
c > -(3/4) || c < -(3/4)]}, 
 {x ->  ConditionalExpression[Root[-1 + 4 c #1 + 4 #1^3 &, 2],  c < -(3/4)]}, 
 {x ->  ConditionalExpression[Root[-1 + 4 c #1 + 4 #1^3 &, 3],  c < -(3/4)]}}

 Eliminate[c == -x - x^2 && x == y[1], x]
share|improve this question

3 Answers 3

It's a bit unclear to me what you are asking, but if I interpret your question and your comment to Peter Breitfeld's answer correctly you want to solve the system

eqs = {g'[x] == 1, x^2 + x + c == 0}

for x and c. This can be done using Solve, e.g.

Solve[eqs, {x, c}]

(* output: {{x -> -(I/2), c -> 1/4 + I/2}, {x -> I/2, c -> 1/4 - I/2}} *)
share|improve this answer

I'm not sure if I understand your question correctly. But if you want to see the solutions depending on c this may be an approach:

f[x_] := x^2 + c;
g[x_] := f[f[x]];
y[c_] = Solve[g'[x] == 1, x, Reals]
xval[c_] := DeleteCases[y[c], {x -> Undefined}]

Test:

xval/@{-1,-3/4,1}
(*
{{{x -> Root[-1 - 4 #1 + 4 #1^3 &, 1]}, {x -> Root[-1 - 4 #1 + 4 #1^3 &, 2]}, 
  {x -> Root[-1 - 4 #1 + 4 #1^3 &, 3]}}, {}, {{x -> Root[-1 + 4 #1 + 4 #1^3 &, 1]}}}
*)
share|improve this answer
    
i want the solutions as c=a, etc, based on the equation c=-x-x^2, so i want a way to solve for c based on the x values i have obtained. –  John Stamos May 6 '12 at 10:07

How about the following?

c /. First@Solve[Expand[g'[x]] == 1, c]

Result is:

(1 - 4*x^3)/(4*x)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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