1. The problem statement, all variables and given/known data I am currently doing an experiment on Compton scattering and have plotted a linear graph of 1/E' on (1-cos θ), where E' is the scattered gamma ray energy. My goal is to find the value of the gradient and y-intercept with their corresponding uncertainties. Instead of using the statistical uncertainty as given by excel's LINEST function, I want to use the physically obtained ones. i.e. Due to the limitations of the apparatus. This has resulted in varying error bars for each point, which makes it very difficult to find the lines with max/min gradient. Is there any function in excel to find the max/min gradient lines? I use Mathematica too if it helps. 2. Relevant equations The equation is: 1/E' = 1/E + 1/mc2(1-cos θ) The gradient is 1/E and the y-intercept is 1/mc2 3. The attempt at a solution I know I can probably do it the brute force way- adjusting the lines until it fits within the error bars. But I' ve encountered this a few times already and I'm wondering if there is a function to do it quickly.