- Cuchulainn
**Posts:**64375**Joined:****Location:**Drosophila melanogaster-
**Contact:**

Can [$](1-x)(1+x)log((1+x)/(1-x)) [$] ever become unbounded? (not including the infinities).

"Compatibility means deliberately repeating other people's mistakes."

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

I'd say it's a bounded function for any real |x| <= 1 or indeed on any bounded domain for x.Can [$](1-x)(1+x)log((1+x)/(1-x)) [$] ever become unbounded? (not including the infinities).

But, it becomes an unbounded complex function on the real line or half-line

- Traden4Alpha
**Posts:**23951**Joined:**

for |x|>1, f is complex;

for |x|<1, f is real; and

for |x|=1, f converges to 0 from both sides

Obviously, a sequential computation for x approaching either +1 or -1 might have unbounded intermediate terms but the full expression remains bounded.

for |x|<1, f is real; and

for |x|=1, f converges to 0 from both sides

Obviously, a sequential computation for x approaching either +1 or -1 might have unbounded intermediate terms but the full expression remains bounded.

it's bounded except at what you term the infinities at [$]|x|=\infty[$]

[$](1-x)(1+x)\ln\frac{1+x}{1-x}=(1-x)(1+x)\ln(1+x)-(1-x)(1+x)\ln(1-x)[$]

the only potential problem values would have been [$]x=\pm 1[$] and if you look at those 2 points, you see that they are not in fact problems because the factors (1+x) and (1-x) out front kill any bad behavior from the logarithm

as [$]x\to 1[$] it tends to [$]-2(1-x)\ln(1-x)\to 0[$]

as [$]x\to -1[$] it tends to [$]2(1+x)\ln(1+x)\to 0[$]

[$](1-x)(1+x)\ln\frac{1+x}{1-x}=(1-x)(1+x)\ln(1+x)-(1-x)(1+x)\ln(1-x)[$]

the only potential problem values would have been [$]x=\pm 1[$] and if you look at those 2 points, you see that they are not in fact problems because the factors (1+x) and (1-x) out front kill any bad behavior from the logarithm

as [$]x\to 1[$] it tends to [$]-2(1-x)\ln(1-x)\to 0[$]

as [$]x\to -1[$] it tends to [$]2(1+x)\ln(1+x)\to 0[$]

- Cuchulainn
**Posts:**64375**Joined:****Location:**Drosophila melanogaster-
**Contact:**

Very good. I think it can in general be boiled down toit's bounded except at what you term the infinities at [$]|x|=\infty[$]

[$](1-x)(1+x)\ln\frac{1+x}{1-x}=(1-x)(1+x)\ln(1+x)-(1-x)(1+x)\ln(1-x)[$]

the only potential problem values would have been [$]x=\pm 1[$] and if you look at those 2 points, you see that they are not in fact problems because the factors (1+x) and (1-x) out front kill any bad behavior from the logarithm

as [$]x\to 1[$] it tends to [$]-2(1-x)\ln(1-x)\to 0[$]

as [$]x\to -1[$] it tends to [$]2(1+x)\ln(1+x)\to 0[$]

[$]\displaystyle\lim_{x\to0} x^k log(x) = 0[$] for [$]k = 1,2,3,..[$].

The background to my problem was transforming the real line to [$](-1,1)[$] by [$]y = tanh(x)[$] for a PDE(x) to PDE(y) and you want the transformed coefficients to be bounded.

//

BTW it seems that [$](1/2)\log\frac{1+x}{1-x}[$] is called the Fisher z-transform.

"Compatibility means deliberately repeating other people's mistakes."

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

This is the sort of post that gives a mathsy website a bad reputation, not stories about Donald Trump.

- Traden4Alpha
**Posts:**23951**Joined:**

We all know Donald Trump is unbounded on both the real and fake number systems.

- Traden4Alpha
**Posts:**23951**Joined:**

Well, I'd hate for this site to be branded as suspicious for having lots of terrorizing al' gebra, al' gorithms, and references to Osama bin Ary

that's true for all [$]k>0[$], not just for integers, so e.g. [$]\displaystyle\lim_{x\to0} x^{1/2} log(x) = 0[$]I think it can in general be boiled down to

[$]\displaystyle\lim_{x\to0} x^k log(x) = 0[$] for [$]k = 1,2,3,..[$].

- Cuchulainn
**Posts:**64375**Joined:****Location:**Drosophila melanogaster-
**Contact:**

There's only one thing worse than talking about maths, and that's not talking about it. It will last longer than Donald Trump who will be vote out in 2 years.This is the sort of post that gives a mathsy website a bad reputation, not stories about Donald Trump.

"Compatibility means deliberately repeating other people's mistakes."

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

- Cuchulainn
**Posts:**64375**Joined:****Location:**Drosophila melanogaster-
**Contact:**

It's silly question time again and today's silly question is:

Consider the continuous 'hat' function

[$]f(x) = 2x, 0 \leq x \leq 1/2; [$] [$]f(x) = 2(1-x), 1/2 \leq x \leq 1[$].

I want to approximate [$]f(x)[$] to any accuracy by (ideally) an infinitely differentiable function. An analytical and easily computable solution is desired. Ideally, the approximation should be in continuous space; failing that, a discrete approximation might be OK.

// Some Wilmotters might remember a similar question a while back ..(the one with the Jack Nicholson avatar).

Consider the continuous 'hat' function

[$]f(x) = 2x, 0 \leq x \leq 1/2; [$] [$]f(x) = 2(1-x), 1/2 \leq x \leq 1[$].

I want to approximate [$]f(x)[$] to any accuracy by (ideally) an infinitely differentiable function. An analytical and easily computable solution is desired. Ideally, the approximation should be in continuous space; failing that, a discrete approximation might be OK.

// Some Wilmotters might remember a similar question a while back ..(the one with the Jack Nicholson avatar).

David Wheeler

http://www.datasimfinancial.com

http://www.datasim.nl

approximate on what interval?

[0,1] you could use a fourier series

or stretch it to [-1,1] and use chebyshev

[0,1] you could use a fourier series

or stretch it to [-1,1] and use chebyshev

(edit ppauper and I cross posted, I was also thinking about Chebyshev)

---

I tried a Chebyshev approximation (which is infinitely differentiable since it's a sum of (orthogonal) polynomials), but it doesn't converge very fast. I bet that'll be a general issue with geneneric (popular) polynomial basis because of the discontinuity of the derivative at the peak on one hand and you wanting infinitely differentiability at the other hand.

Perhaps cutting off the top -just a tiny bit- and replacing it with a spline that matches derivatives left and right will be a good approximation, and infinitely differentiable?

---

I tried a Chebyshev approximation (which is infinitely differentiable since it's a sum of (orthogonal) polynomials), but it doesn't converge very fast. I bet that'll be a general issue with geneneric (popular) polynomial basis because of the discontinuity of the derivative at the peak on one hand and you wanting infinitely differentiability at the other hand.

Code: Select all

```
import numpy as np
import matplotlib.pyplot as plt
x = np.linspace(-1, 1, 2000)
# hat function
y = 1 - abs(x)
p = np.polynomial.Chebyshev.fit(x, y, 128, domain=(-1,1))
plt.plot(x, y, 'r.')
plt.plot(x, p(x), 'k', lw=2)
plt.title('fit')
plt.show()
plt.plot(x, p(x) - y, 'k', lw=2)
plt.title('error')
plt.show()
plt.semilogy(np.abs(p.coef),'*')
plt.title('maginitude coefficients')
plt.show()
```

Perhaps cutting off the top -just a tiny bit- and replacing it with a spline that matches derivatives left and right will be a good approximation, and infinitely differentiable?

the fourier series is

[$]\sum_{m=1}^{\infty}\frac{8}{m^2\pi^2}\sin\frac{m\pi}{2}\sin m\pi x[$]

[$]\sum_{m=1}^{\infty}\frac{8}{m^2\pi^2}\sin\frac{m\pi}{2}\sin m\pi x[$]