Skip to main content
Corrected FindRoot output
Source Link
bbgodfrey
  • 62.1k
  • 18
  • 92
  • 160

Having just one root requires

eq1 = -k^x + x^2 == 0;
eq2 = D[-k^x + x^2, x] == 0
(* 2*x - k^x*Log[k] *)

FindRoot can solve for x and k simultaneously.

FindRoot[{eq1, eq2}, {{x, 2.5}, {k, 2}}]
(* {x -> 2.71828, k -> 2.08707} *) 

Plot[(-k^x + x^2) /. %[[2]], {x, 2, 3}]

Mathematica graphics

Having just one root requires

eq1 = -k^x + x^2 == 0;
eq2 = D[-k^x + x^2, x] == 0
(* 2*x - k^x*Log[k] *)

FindRoot can solve for x and k simultaneously.

FindRoot[{eq1, eq2}, {{x, 2.5}, {k, 2}}]
(* {x -> 2.71828, k -> 2.08707} *)

Having just one root requires

eq1 = -k^x + x^2 == 0;
eq2 = D[-k^x + x^2, x] == 0
(* 2*x - k^x*Log[k] *)

FindRoot can solve for x and k simultaneously.

FindRoot[{eq1, eq2}, {{x, 2.5}, {k, 2}}]
(* {x -> 2.71828, k -> 2.08707} *) 

Plot[(-k^x + x^2) /. %[[2]], {x, 2, 3}]

Mathematica graphics

Post Undeleted by bbgodfrey
Corrected FindRoot output
Source Link
bbgodfrey
  • 62.1k
  • 18
  • 92
  • 160

Having just one root requires

eq1 = -k^x + x^2 == 0;
eq2 = D[-k^x + x^2, x] == 0
(* 2*x - k^x*Log[k] *)

FindRoot can solve for x and k simultaneously.

FindRooteq1FindRoot[{eq1, eq2}, {{x, 2.5}, {k, 2}}]
(* {x -> 2.4875771828, k -> 2.0806708707} *)

Having just one root requires

eq1 = -k^x + x^2 == 0;
eq2 = D[-k^x + x^2, x] == 0
(* 2*x - k^x*Log[k] *)

FindRoot can solve for x and k simultaneously.

FindRooteq1, eq2}, {{x, 2.5}, {k, 2}}]
(* {x -> 2.48757, k -> 2.08067} *)

Having just one root requires

eq1 = -k^x + x^2 == 0;
eq2 = D[-k^x + x^2, x] == 0
(* 2*x - k^x*Log[k] *)

FindRoot can solve for x and k simultaneously.

FindRoot[{eq1, eq2}, {{x, 2.5}, {k, 2}}]
(* {x -> 2.71828, k -> 2.08707} *)
Post Deleted by bbgodfrey
Source Link
bbgodfrey
  • 62.1k
  • 18
  • 92
  • 160

Having just one root requires

eq1 = -k^x + x^2 == 0;
eq2 = D[-k^x + x^2, x] == 0
(* 2*x - k^x*Log[k] *)

FindRoot can solve for x and k simultaneously.

FindRooteq1, eq2}, {{x, 2.5}, {k, 2}}]
(* {x -> 2.48757, k -> 2.08067} *)