# Figure out a function expression from graph (sine and cosine)

I am trying to recreate the following image in latex (pgfplots), but in order to do so I need to figure out the mathematical expressions for the functions

So far I am sure that the gray line is $\sin x$, and that the redline is some version of $\sin x / x$. Whereas the green line is some linear combination of sine and cosine functions.

Anyone know a good way to find these functions?

-

## 2 Answers

$$f(x)=\frac{\sin\left(\frac{x-x_0}{k}\right)}{\frac{x-x_0}{k}}\cos\left(\frac{x-x_0}{h}\right)$$

with $x_0=100$, $k=10$, $h=2$

-

The gray curve has maximum at $x=0$, so I'd use a cosine. All you need to do to write its function is determine the frequency. It completes one cycle ($2\pi$ radians) at the next peak.

The red line does indeed look like the form $\sin(x)/x$ but note that the peak is at $x=100$, and that the zero crossings occur three times for every $100$ units of $x$ (pretending there's a zero crossing at the peak; the sine has one even if the whole function doesn't). So you need to shift the position of the function and set its frequency. $\sin(a(x-100))\over{a(x-100)}$. All you have to do is figure out $a$ such that you get $\pi$ radians when $x$ changes by $33.333...$

The green curve looks like the product of the gray and red curves.

-
{"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": 16, "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}, "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}, "english_confidence": 0.9469491243362427, "perplexity_flag": "head"}