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?

  • 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$
    – user484
    Commented May 13, 2015 at 6:40

2 Answers 2


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 *)

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:

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}


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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