Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

#1: Initial revision by user avatar r~~‭ · 2022-11-27T23:35:05Z (almost 2 years ago)
Since you haven't specified that such a function needs to be continuous or well-behaved in any way, it's quite easy to describe one.

The integral $\int_0^1 \frac1x\,dx$ diverges, so there is an infinite amount of area to work with. Measure off the section of curve with area 1 starting at $x = 1$ and working toward $x = 0$. Then measure off the next section of curve with area 1/2 and negate the curve over that interval. Then measure off the next section of curve with area 1/3 and skip over it, measure off the next section of curve with area 1/4 and negate it, etc. The resulting function has the desired property—by construction, its integral from 0 to 1 is $1 - \frac12 + \frac13 - \frac14 +\ldots = \log(2)$ but the integral of its absolute value (which remains $\frac1x$) diverges.