Wikipedia:Reference desk/Archives/Mathematics/2022 December 15
Appearance
Mathematics desk | ||
---|---|---|
< December 14 | << Nov | December | Jan >> | December 16 > |
Welcome to the Wikipedia Mathematics Reference Desk Archives |
---|
The page you are currently viewing is a transcluded archive page. While you can leave answers for any questions shown below, please ask new questions on one of the current reference desk pages. |
December 15
[edit]Approximating y = e^x
[edit]I want to approximate y = e^x in the range x = a to x = c with two line segments (a, e^a) (b, e^b) and (b, e^b) (c, e^c) such that the error defined as the area between the original y = e^x and the two segments is minimised. All I really care about is the ratio (b - a) / (c - a).
I'm pretty sure I could do this by finding an expression for the area, taking the derivative, setting it to zero and solving for x to find b, but it feels like the solution shouldn't depend on a or b or even e, so all of that seems like it might be overkill.
Is there an obvious answer that I'm missing?
2A01:E34:EF5E:4640:4210:3448:E6A9:8778 (talk) 22:03, 15 December 2022 (UTC)
- If you increase a and c together while keeping (c-a) fixed, say a -> a+d and c -> c+d, that just scales the areas up by a multiplicative factor of e^d. Therefore, the quantities (b-a) and (c-b) only depend on (c-a). We can say b = a + f(c-a) where f is some function. Perhaps that's the "shouldn't depend" that you're intuiting? Given that observation, you can simplify the calculation by setting a=0, then work out the answer just as you suggested. --Amble (talk) 00:13, 16 December 2022 (UTC)
- Hi! The only direct thing comes to my mind is Taylor series expansion. However, I am not sure regarding the ratio part of the question. Are you trying to say ration between area under curve in both line segments (?). If so, I would highly recommend to work out on paper and see if this is something you want. I hope this helps! :) Cheers, Nanosci (talk) 00:17, 16 December 2022 (UTC)
- The Leibniz integral rule is simple here because the integrands are zero at . I get:
- so
- Try , , then which seems plausible. catslash (talk) 01:30, 16 December 2022 (UTC)
- On further consideration, for any function , the area is stationary when
- that is, the point at which the slope of the function is the average slope over the interval. catslash (talk) 02:32, 16 December 2022 (UTC)
- I think this is correct. Here is another way of obtaining the result. By scaling we can choose The piecewise linear function on the interval fixed by the three points never assumes values exceeding those of so to minimize the difference in areas we can simply seek to maximize the area between and the x-axis, formed by two trapezoids glued back-to-back:
- Solving results in --Lambiam 07:21, 16 December 2022 (UTC)
- I think this is correct. Here is another way of obtaining the result. By scaling we can choose The piecewise linear function on the interval fixed by the three points never assumes values exceeding those of so to minimize the difference in areas we can simply seek to maximize the area between and the x-axis, formed by two trapezoids glued back-to-back:
- that is, the point at which the slope of the function is the average slope over the interval. catslash (talk) 02:32, 16 December 2022 (UTC)
- Thankyou all. So as I suspected a and b are not relevant, but e actually is. I had the feeling that the base would end up canceling out and the ratio would end up being a common constant such as 0.5 or the golden ratio or something. 08:34, 16 December 2022 (UTC) — Preceding unsigned comment added by 2A01:E34:EF5E:4640:6743:DBBA:BC3:542 (talk)
- Knowing the answer from having ground through the integrals, hindsight makes it obvious geometrically:
- The area between the line segments and the curve is the area under the line segments minus the area under the curve.
- The area under the curve is fixed, so the problem reduces to minimizing the area under the line segments (subject to the middle point being on the curve)
- That is equivalent to maximizing the area of a triangle whose (upward facing) 'base' is a single straight line between the end points and whose 'apex' is the middle point (b, f(b)) of the line segment pair.
- The area of a triangle is half the base times the height, so the area is stationary (and possibly maximal) when the apex is moving parallel to the base.
- So the solution lies at a point where the slope of the curve is equal to the average slope over the interval.
- catslash (talk) 19:23, 16 December 2022 (UTC)
- Knowing the answer from having ground through the integrals, hindsight makes it obvious geometrically: