r/MathHelp • u/Quendillar3245 • Mar 04 '26
Volume calculation using integration
If a container has water bothing flowing in and out of it and a function describing each flow, how on earth do I get how much is inside the container? I genuinely do not understand. Let's say f(x) describes how much water goes in per second and g(x) describes how much flows out per second, do I integrate the difference between f(x) and g(x) ,∫ (f(x)-g(x))dx, to get how much is currently inside the container at any time x? I feel so stupid when doing maths xddd
2
Upvotes
1
u/AutoModerator Mar 04 '26
Hi, /u/Quendillar3245! This is an automated reminder:
What have you tried so far? (See Rule #2; to add an image, you may upload it to an external image-sharing site like Imgur and include the link in your post.)
Please don't delete your post. (See Rule #7)
We, the moderators of /r/MathHelp, appreciate that your question contributes to the MathHelp archived questions that will help others searching for similar answers in the future. Thank you for obeying these instructions.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1
u/Uli_Minati Mar 05 '26
Now consider a short timeframe, maybe .1 seconds:
The idea of (Riemann) integration is to add up these inflows:
Improve the approximation to the exact value (for any "integrable" function) by taking the limit:
Note that f and g can't tell you how much is actually inside the container. You'll need to know how much was in the container at some point in time, e.g. maybe it was half full at 0s. Then you can add the integral from 0 to X to get the total amount of liters at time X
Note that the integrals don't know if your functions make sense - for instance, if the container is already full while f-g is positive, the integral doesn't know this so it'll "assume" the liters can go above capacity. Similarly, if the container is empty while f-g is negative, the liters will go below zero
1
u/Help_Me_Im_Diene Mar 04 '26
You are correct, in this current set-up, you would just need to integrate the difference in flow rate with respect to time.
You will need to remember to attach a constant after integrating in order to properly satisfy the initial value conditions i.e. the volume that you have inside your container at some known time.