# Need a function with a jump discontinuity

1. Jul 16, 2012

### mesa

What would be a good example of a function that would give a jump discontinuity without using piecewise or absolute values?

2. Jul 16, 2012

### pwsnafu

What do you know about Fourier series?

Last edited: Jul 16, 2012
3. Jul 16, 2012

### mesa

Not much other than what wikipedia spits out, just barely finished calc I. I am willing to listen if you can explain it.

Is that the only way to produce a jump discontinuity outside of absolute value or piece wise?

4. Jul 16, 2012

### Mute

$$y(x) = \tanh\left(\frac{1}{x}\right)?$$

5. Jul 16, 2012

### chiro

Hey mesa.

You won't be able to represent a discontinuous function with any continuous function (including a fourier series expression mentioned above), but if you want to use an analytic expression, fourier series is a good way to do this.

One other possible way is think of specific kinds of function compositions, but this way will be a trial and error kind of approach and not a systematic one that is used in the fourier analysis approach.

The idea is that you can think of a fourier basis like an infinite-dimensional vector space where you "project" your function on to each orthogonal basis vector (instead of having say i,j,k,... where these are geometric vectors, your basis vectors are sin(pix), cos(pix), sin(2pix), cos(2pix) etc) and then just like you would write out a vector in terms of its linear combination of basis vectors, you write your function out as a linear combination of its basis vectors like sin(pix), cos(pix) and so on. Depending on the interval, the sin(pix) may be something different, but the idea is the same.

Then if you only want an approximation keep the ones with the lower frequency information and toss out the rest (a common approach in signal analysis).

6. Jul 17, 2012

### mesa

So the Fourier Series basically uses 'axes' made up of trigonomic functions (i.e. sin, cos, etc. of ∏x) . They were chosen because they have an infinate number of real roots (at least without performing a transformation); it is at these orthogonal points that the fourier series places itself.

Which part is wrong?

Last edited: Jul 17, 2012
7. Jul 17, 2012

### mesa

At what yalue of x is the jump discontinuity?

8. Jul 17, 2012

### chiro

It's not that: they are significant with respect to everything from geometry, to a continuous form of number theory (since they are periodic), and to the concept of using frequency to analyze things as is done in many many transforms.

This fourier decomposition is an example of an integral transform. Basically what this means is that you have an expression (i.e. a function or a signal) and you put it through this black-box and it spits out something: in this case its a number with respect to the basis vector. Then what you do is you have an inverse process which takes the results of your black-box and reconstructs the input.

There are different kinds of black-boxes and they do different things, but they all have a black-box and a reverse black-box where if you chain the reverse box after the normal box you always get back what you put in initially (provided you meet some conditions).

As it turns out, the reason they are powerful is that they are orthogonal. Orthogonal means completely independent: kind of like if you have a vector <x,y,z> and you change y then x and z don't change at all.

There are other reasons, and you can look up any kind of signal processing and pure math to find out, but the idea of taking any function over a finite interval (from -pi to pi for the default case) and then turn it into a vector (an infinite-dimensional one) is very powerful because its a standard way to take a signal and give it geometry.

The axis correspond with the trigonometric functions and the way you interpret is that the value at each axis is like the component of each vector. For example <x,y,z> have the value of x on x-axis, y on y-axis, and z on z-axis so your thinking is a good one if you think about things in terms of a vector.

If you are interested there is a whole area called fourier analysis of which you deal with orthogonal polynomials which create vectors (like the one above) but the vectors represent something different.

So we will get numbers for a different basis, but those numbers refer to the basis of our orthogonal polynomial and not just the trig functions.

If you want to understand geometry better, then look at a linear algebra textbook to understand all this stuff for normal vectors and then you will see how this kind of thing works: you will have to learn the finite-dimensional stuff before the infinite-dimensional stuff but the ideas are the same in both.

9. Jul 17, 2012

### mesa

There is a lot of information packed in there. It would seem this could take a long time to grasp, Ill revisit it again when I am more comfortable with the concepts.

Is there any other solution for producing a jump discontinuity? In other words using trig and algebra?

10. Jul 17, 2012

### Mute

Why don't you plot it and see? Or better yet, try to figure out at what value you expect the discontinuity to be. Tanh(x) is a bounded, continuous function, so what value of x would you expect Tanh(1/x) to not be continuous? i.e., what problem could an argument of 1/x introduce that an argument of x doesn't?

11. Jul 17, 2012

### Bohrok

Or cot-1x.

12. Jul 17, 2012

### mesa

I asked which value of x(s) because of your question mark :)

I've been steered down the wrong path a few times so always good to get more info first, but you seem confident now, I'll monkey with it

13. Jul 17, 2012

### mesa

The domain is not restricted and the range is 0 to ∏
What am I missing Bohrok? :)

14. Jul 17, 2012

### Bohrok

Once again, I forgot about the true graph of cot-1x :uhh:

WolframAlpha likes to show the graph like this:

15. Jul 18, 2012

### Mute

The question mark was indicative of a suggestion using colloquial speech, as in, "Why don't you take a look at this?", rather than just saying "Look at this function." Plotting the function with wolframalpha will immediately demonstrate that the function indeed has a jump discontinuity.

I will leave it up to you to figure out why it has a jump discontinuity.

16. Jul 18, 2012

### mesa

Hah, no problem, how does wolfram get this other graph?

17. Jul 18, 2012

### mesa

Well your question mark would lead most people to think, "I am uncertain" ;)

How is it that wolfram has a completely different graph for the same function and still mean the same thing? I would guess it is changing one of the axes to be a different representation of the value, like how the sin curve is a graph of x vs y in radians as opposed to just its actual y values on the unit circle.

What's the scoop?

18. Jul 18, 2012

### Mute

Which function are you referring to? $\arccot(x) (= \cot^{-1}(x))$, or the one I suggested? The problem with y = arccot(x) is that on computer systems a one-argument version of the function cannot tell which quadrant the resulting angle y should be in. Since cot(y) = adjacent/opposite, if both the adjacent and opposite sides are negative (i.e., the angle is in quadrant 3), then the minus sign cancels out, and so typically implementations of y = arccot(adjacent/opposite) don't know that and will put angles that are supposed to be in quadrant 3 into quadrant 1. Similarly, quadrant 4 angles get sent to quadrant 2. This leads to a discontinuity in arccot(x) when this definition of the function is used.

The typical example of this behavior is actually arctan(x). For the same reasons as for arccot(x), many computer implementations of arctan(x) have a jump discontinuity. As a result, a special function atan2(x,y) is available on many systems, where x is the adjacent side length and y is the opposite side length. The function atan2(x,y) places the angle in the correct quadrant and has no discontinuity.

If you are asking about wolframalpha plotting tanh(1/x), then I am not sure what you are asking. Wolframalpha should properly plot that function. The issues with arctan(x) do not arrise for this function.

(In case you haven't encountered it before, Tanh(x) is the hyperbolic trig function defined by

$$\tanh(x) = \frac{e^{x}-e^{-x}}{e^{x}+e^{-x}}.$$
)

19. Jul 20, 2012

### mesa

I've been playing with derivations on those. So the hyperbolic funtions use X^2-y^2=1 as opposed to the unit circle in trig and the derivations are all based off of that right?

I get that the sinh x = (e^x-e^(-x))/2
and cosh x = (e^x+e^(-x))/2

giving your $$\tanh(x) = \frac{e^{x}-e^{-x}}{e^{x}+e^{-x}}.$$
etc. etc.

but I still need to figure out how to derive the first step
sinh x= (e^x-e^(-x))/2

20. Aug 5, 2012

### Bohrok

I got one that I discovered from another thread that's not piecewise and has no absolute values:

$$x\left(\sqrt{1+\frac{1}{x^2}}-1\right)$$