Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6925831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:50:25+00:00 2026-05-27T10:50:25+00:00

With Mathematica 8.0.1.0, I have used FindRoot[] to identify the intersection of two 2

  • 0

With Mathematica 8.0.1.0, I have used FindRoot[] to identify the intersection of two 2 pdf functions.

But if I have pdf functions that intersect at more than one point, and I have the upper limit of the x axis range beyond the second intersection, FindRoot[] only returns the second intersection.

pdf1 = 1/x 0.5795367855565214` (E^(
  11.170058830053032` (-1.525439351903338` - Log[x]))
   Erfc[1.6962452696714152` (-0.5548887795964352` - Log[x])] + 
 E^(1.2932713057519` (2.60836043407439` + Log[x]))
   Erfc[1.6962452696714152` (2.720730943938539` + Log[x])]);

pdf2 = 1/x 0.4648445097126269` (E^(
  5.17560914275408` (-2.5500941338198615` - Log[x]))
   Erfc[1.7747318880142482` (-2.139288893723375` - Log[x])] + 
 E^(1.1332542415053757` (3.050849516581922` + Log[x]))
   Erfc[1.7747318880142482` (3.1407996592474956` + Log[x])]);

Plot[{pdf1, pdf2}, {x, 0, 0.5}, PlotRange -> All]   (* Shows 1st intersection *)
Plot[{pdf1, pdf2}, {x, 0.4, 0.5}, PlotRange -> All] (* Shows 2nd intersection *)

{x /. FindRoot[pdf1 == pdf2, {x, 0.00001, 0.5}],
x /. FindRoot[pdf1 == pdf2, {x, 0.00001, 0.4}]}

enter image description here
enter image description here

The above plots show the issue. When plotted they intersect at two points:

{0.464719, 0.0452777}

respectively.

As I can’t know before hand if I’ll have a second intersection and I don’t know where it might fall on the x axis if I did, can anyone suggest a way to have FindRoot[] only return the first intersection rather than the second?

If not, can anyone suggest another way to go about it?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:50:26+00:00Added an answer on May 27, 2026 at 10:50 am

    With FindRoot[], you can only get a single root for a given starting point. Iterating through different options is cumbersome and you might not even get the desired result for certain edge cases unless you hit upon the right choice of starting point.

    In this case, something like NSolve or Reduce might be a better option. If you know that your expressions decay, using a reasonable upper bound for possible values of x, you can use the following, which is pretty quick and will give you all roots.

    NSolve[{pdf1 == pdf2, 0 < x < 1}, x] // Timing
    Out[1]= {0.073495, {{x -> 0.0452777}, {x -> 0.464719}}}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of user-defined functions that are frequently used in mathematica. I
I've created some mathematical functions that will be used in main() and by member
One of the hardest things for me to debug, is when Mathematica says that
I have been mostly a Table functions user in mathematica. However I have noticed
I have been working for two years in software industry. Some things that have
I have seen many recursive functions(mostly used in computing some mathematical operations e.g. factorial,
In order to solve x^2 == 123456 mod 1299709 in Mathematica I have used:
In Mathematica I have a list: x = {1,2,3,3,4,5,5,6} How will I make a
I have a javascript function that accepts a number and performs a mathematical operation
Let's say I have a text file of basic mathematical functions. I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.