Invent a function

I'm supposed to invent a continuous function f: R into R such that its improper integral is zero, but which is unbounded as x approaches negative infinity and x approaches infinity.
I have no clue how to do this problem. Could somebody help me? Thanks

I'm supposed to invent a continuous function f: R into R such that its improper integral is zero, but which is unbounded as x approaches negative infinity and x approaches infinity.
I have no clue how to do this problem. Could somebody help me? Thanks

On each interval , the curve of the function has the shape of a triangle which has one vertex at , one at and one at . As approaches , the height of the triangle does the same (see the second vertex) so the function is not bounded. It can be checked that this function is continuous on . As, for , (it's the area of a triangle which height is and which base is ), we get that and the function is integrable.

On each interval , the curve of the function has the shape of a triangle which has one vertex at , one at and one at . As approaches , the height of the triangle does the same (see the second vertex) so the function is not bounded. It can be checked that this function is continuous on . As, for , (it's the area of a triangle which height is and which base is ), we get that and the function is integrable.

i was thinking about something like that. but is that function continuous?

Sorry, I overlooked the continuity requirement. To get round that, you can to replace the isolated values f(n)=n at integer points by narrow triangular spikes. For example, for every n (apart from n=0 or ±1) the function could go linearly from 0 to n in the interval , and then linearly from n to 0 in the interval . The area of this triangle is 1/n^2, which means that the sum of the areas converges, so the function is integrable. Also, the function is odd, so its integral is zero.

If you write out the formulas for this construction, you get exactly what flyingsquirrel wrote.