Post Reply 
Integral puzzle with absolute value function
12-10-2019, 05:30 PM (This post was last modified: 12-10-2019 10:08 PM by Albert Chan.)
Post: #4
RE: Integral puzzle with absolute value function
I with non-zero lower limit, we can simply expand the "products" (assumed d ≥ c, b ≥ a)

I = (d Θ c) • (b Θ a) = (d • b) - (d • a) - (c • b) + (c • a)

Example: (8 Θ 3) • (7 Θ 2) = (28 pi) - (8 pi) - (10 pi + 2) + (3 pi) = 13 pi - 2

But there is an easier way:
Code:
r = (d-c) * (b-a)
I = (r//2) * pi
if odd(r): I += (pi-2) if odd(a+c) else 2

Redo same example: r = (8-3) × (7-2) = 25 = 26 - 1               → I = 13 pi - 2

Prove: with integrand period of 2q, we can shift the limit, into 3 cases.
Above example is last case: (5 Θ 0) • (6 Θ 1) = (15 pi) - (2 pi + 2) = 13 pi - 2

1). (d Θ 0) • (b Θ 0) = d • b (same as previous post)

2). (d Θ 1) • (b Θ 1) = (d • b) - (d • 1) - (b • 1) + (1 • 1)
Tried all combinations ((b+d) odd, and even), above = (d - 1) • (b - 1)

3). (d Θ 0) • (b Θ 1) = (d • b) - (d • 1)                                      // a+c is odd

If r = d(b-1) is even, above = d • (b - 1)

If r is odd, above = (½ d b pi) - (½(d-1) pi + 2) = ½(db - d - 1) pi + (pi - 2)
However, d • (b - 1) = ½(db - d - 1) pi + 2
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Integral puzzle with absolute value function - Albert Chan - 12-10-2019 05:30 PM



User(s) browsing this thread: 1 Guest(s)