I used this code for numerical integration

NIntegrate[(x^2 - .0015 x^4)/D[(x^2 - .0015 x^4), x], {x, 1.414, 13}]

when upperlimit of x is 13, the integral value is 50.

Now I want to find the upper-limit of this integration where integration value is known i.e. 50. I write the follwing code

PL = NIntegrate[(x^2 - .0015 x^4)/D[(x^2 - .0015 x^4), x], {x, 1.414, v}];
FindRoot[PL == 50, {v, 11}]

But this code is not giving me the correct value of v. Even when i change {v,11} to {v,10} or {v,7}, it shows different values of v. I plotted PL as a function of v from 0 to 14. But when I agian crosscheck using the ouput as upperlimit of numerical integration I do not get back 50.

enter image description here

  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 0) Browse the common pitfalls question 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Read the faq! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$ – Dr. belisarius Mar 25 '15 at 4:46
  • $\begingroup$ You've been using the site for four months now.You should learn how to upvote/downvote $\endgroup$ – Dr. belisarius Mar 25 '15 at 4:47

You can also use Solve

     (x^2 - .0015 x^4)/D[(x^2 - .0015 x^4), x],
     {x, 1.414, v}] == 50, v, Reals][[1]] // Quiet

{v -> 12.9905}

| improve this answer | |
s[v_?NumericQ] := NIntegrate[(x^2 - .0015 x^4)/D[(x^2 - .0015 x^4), x], {x, 1.414, v}]
FindRoot[s[v] == 50, {v, 11}]
(* {v -> 12.9905} *)
| improve this answer | |
  • $\begingroup$ But when you change {v,11} to {v,1}, it gives different value $\endgroup$ – Abhijit Saha Mar 25 '15 at 4:43
  • $\begingroup$ Is there any way to do this without defining a new function? $\endgroup$ – Louis Yang Jan 17 '17 at 20:59

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.