Find the value of $n$ that minimizes a complicated integral

40 Views Asked by At

I need to approximate this function:

$$f(x)=\left\{\begin{matrix} \sqrt{21.49-(x+1.28)^2 }\ \ \ \text{if } x<-3.17\\ \sqrt{60.56-x^2 }-2.87\ \ \ \text{if } -3.17\leq x\leq 3.17\\ \sqrt{21.49-(x-1.28)^2} \ \ \ \text{if } x>3.17 \end{matrix}\right.$$

With a more simple one. I found out that:

$$g(x)=4.91\left(1-\frac{4x^2}{11.84^2}\right)^{\frac{1}{n}}$$

Works really well for some value of $n$ . To optimize the value of this parameter I'm trying to minimize the middle error integral:

$$E=\frac{\int_{-5.92}^{5.92}|f(x)-g(x)|}{11.84}$$

With some little tricks(for example noticing that the two functions are even, and noticing that an ellipse approximates pretty well $f$ so $n\approx 2$) and using Geogebra I managed to find:

$$n_{optimal}\approx 2.2 $$

But I can't go deeper with the precision because Geogebra is a limitated software. Can you help me with a more powerful software in finding a more precise value for $n_{optimal}$

[Important!: the extremes of integration are a bit approximated, the precise value should be $\pm 5.915...$]

Thank you :)