3
$\begingroup$
    F1[x_] := NIntegrate[E^Sin[y x], {y, 0, 1}]
    F2[x_] := Log[x]
    NSolve[F1[x] == F2[x], x]

I want to solve the equation, but Mathematica don't solve it. What I should do?

$\endgroup$
  • 5
    $\begingroup$ For one thing, DSolve is for solving differential equations. For another, an equation with a non-analytical integral is probably too hard for Solve and NSolve. Try FindRoot[..., {x, 1}]. $\endgroup$ – Rahul May 13 '15 at 6:40
9
$\begingroup$

This can be solved via a numerical method called fixed point iteration reasonably quickly...

FixedPoint[F1[#] - F2[#] + # &, 2, 100]
(* result 4.609527035642726` takes about 0.327602 seconds on my machine *)
$\endgroup$
9
$\begingroup$

Let's first define F1 to take only numeric arguments because otherwise FindRoot or other functions you might use on it will try to supply some symbolic arguments to it and result in uninteresting messages:

Clear[F1]
F1[x_?NumericQ] := NIntegrate[E^Sin[y x], {y, 0, 1}]

Now plot the functions to see an expected starting point for solution search:

Plot[{F1[x], F2[x]}, {x, -3, 15}]

two functions plot

Now we can see the solution is near 5, so let's just find the root:

FindRoot[F1[x] == F2[x], {x, 5}]

{x -> 4.60952703564273}

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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