# Why should these two functions approximate each other so well?

I am a physicist and during some of my research I realized that $\log_2 \sec(\pi x)$ is really well approximated by $\frac{6x^2}{1-x}$ for small but positive $x$. Is there any reason this should be so? After all the former function looks quite unwieldy on first sight. In particular, I am wondering whether there is some context in mathematics where these functions would arise, with the hope of understanding why they should agree so well. (Note that if I instead simply Taylor expand the former function and keep the leading term, it performs much more poorly.)

EDIT: Here is a plot from WolframAlpha:

Note that at $x= \frac{1}{2}$, the former function has a singularity.

Edit: There were comments about the Taylor series and Padé approximants at $0$. The approximation is neither, and it is not exceptional at $0$, but it seems good on the interval $[0,1/3]$.

• I do not see that this approximation is particularly good, nor is any reason given here. – Michael Renardy May 9 '17 at 0:26
• @MichaelRenardy Fair enough, I have added a plot to illustrate the point. – Ruben Verresen May 9 '17 at 0:33
• I don't understand the reason for the close votes. Isn't it a genuine question to ask why I can approximate such a complicated function by such a simple function, considering that the answer is not just a simple consequence of Taylor expansion? – Ruben Verresen May 9 '17 at 0:38
• I retracted my close vote. I thought this would just be a Padé approximant, but it is not the degree-$(2,1)$ approximant $\frac{\pi^2 x^2}{2 \log 2}$. Instead, this reminds me of a least-squares approximation with respect to some measure, which is not the closest possible at $0$ but which stays small for a long time. – Douglas Zare May 9 '17 at 0:41
• @T.Amdeberhan: Yes, you can read that from the Taylor series which disagree on the second term, $6x^2$ vs. $7.12x^2$. – Douglas Zare May 9 '17 at 1:06

A somewhat better rational approximation for your function with the same degrees of numerator and denominator on the interval $[0, 0.35]$ is $$\frac{-0.003425070267307+(.24505402726368+6.15039272385520 x) x}{1.26465060967883-1.51228919816475 x}$$ (obtained using the Remez algorithm in Maple). Here is a plot of the differences between $\log_2(\sec(\pi x))$ and these approximations (mine in red, yours in blue).
• Remez minimizes the supremum of the difference, right? Is there something similar that would let you set the difference to be $0$ at $0$ and $1/3$ and minimize the integral of the square of the differences with respect to some measure? – Douglas Zare May 9 '17 at 1:10
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.898017942905426, "perplexity": 351.4828955741267}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-29/segments/1593655921988.66/warc/CC-MAIN-20200711032932-20200711062932-00498.warc.gz"}