Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Help needed solving π(x)

  1. Jun 12, 2012 #1
    How do you solve f(t) = cos(t) * E ( cos( (c_1 *x) / t )/x for x from 0 to t or 0 to infinity. This is meant to be a loose representation of a case where the amplitude of frequencies vary by a cosine and also fall off at a rate of 1/x as frequencies increase.

    I also tried to use an integral of cos(c_2 * x)/x which appears to be somewhat related to this problem from what I can find the integral may not be solvable. If it helps any x can be replaced with x/ln(x) but I don't see how the integral (cos((c_3 * x/ln(x)) * ln(x)) / x will be any easier to solve.


    I'm currently working on a formula to solve π(x) but I have run into a dead end which in my experience makes me think I may be very close. But I need some ideas for calculating this last part. To give you some background on the formula I've created something of a polynomial using fractional roots.

    I found a solution to correct a critical problem with this method using what is known about x/ln(x). Now when I graph my error what I have remaining is something that resembles a radio wave with multiple bands.

    My error for π(x) up to 10^5 is currently < +/- 50 which is as high as I'm able to calculate with my limited computing resources.

    What I could tell visually was that lower frequencies had higher amplitudes which is something that gave me hope that I may still be headed in the right direction so I built a Cooley-Turkey FFT engine to graph out my error rate in terms of frequencies.

    Visually I could tell that the amplitudes fell off at a rate ~ 1/x. All of the results were in the complex range showing the error is all in phase and the correction will require a series of negative cosines. What was more startling was that I discovered that near higher frequencies I could clearly see the amplitudes varied as a sign wave going both positive and negative. There are also a few random frequencies that break this pattern but they are few and far between.

    Any assistance you can provide at this point would be appreciated. Any answer doesn't need to be exact. My method for solving π(x) is to continue reducing the error until it is less than 0.4 for all x which would be more than enough for anyone's possible use of this function since the real answer must be an absolute value.
  2. jcsd
  3. Jun 13, 2012 #2
    I don't know if this well help any but after scaling the error to (error * ln(|x|+1)) / (|x|+1) I ran the results through the FFT and ended up with something that looks like a mandelbrot set. I have attached an image. Note that at the center of the image is frequency 0, frequencies increase going both left and right from the origin. On the left is the imaginary part and on the right (where there is nothing) is the real part. The range of this instance is calculating π(x) to +/- 2^10 and the domain of this chart is +2 top and -2 bottom. Before running this through the FFT it is clear that I need to multiply this by a constant to adjust the angle, and the amplitude of this error decreases as x increases.

    Attached Files:

    Last edited: Jun 13, 2012
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook