You posted under Rheem 40 gallon tank-type electric water heater.
You have some hot water so that says specific things:
-Upper element is working.
-Electricity to water heater and circuit breaker are good
-You don't report a leak so TP valve is good
-You are not experiencing overheating event
-ECO reset button is not tripped
-Insulation and covers are in place so thermostat not exposed to cooler temperatures that would cause thermostat to misread temperature and cause overheating.
That leaves 6 suspects listed in order of difficulty:
1) Leaking faucet or broken water line that is running hot water all the time and tank cannot keep up.
2) Thermostats set too low. Turn power OFF, open covers and check each thermostat.http://waterheatertimer.org/How-to-adjust-temperature-on-water-heater.html
3) Loose screw, loose wire at upper thermostat, lower thermostat, or lower element. Turn power OFF and tighten screws, and look for signs of high heat and burning, especially on lower element.
4) Upper or lower thermostat. Replace both thermostats for $28 and see if that corrects problem.
Parts available at home center, hardware, or plumbing supplyhttp://waterheatertimer.org/How-to-replace-thermostat-on-electric-water-heater.html
5) Defective wire between upper and lower sections of tank: If this is the case, and water heater has 2" foam insulation, then tank usually replaced since insulation is too dense to drop another wire. Call for manufacturer for warranty information. Do a full troubleshoot using multimeter.http://waterheatertimer.org/Water-heater-manufacturers.htmlhttp://waterheatertimer.org/How-to-troubleshoot-electric-problems-with-water-heater.html
6) Lower element is burned out. Test lower element. Replace lower element. Rheem elements are 4500 Watts and are available at home center, hardware, or plumbing supplyhttp://waterheatertimer.org/How-to-test-water-heater-element.htmlhttp://waterheatertimer.org/How-to-replace-element-and-clean-sediment-out-of-electric-water-heater.html
Add a comment for more free help.
Also take advantage of fixya phone service.
For a price, expert speaks with you over phone while you work on water heater or any do-it-yourself project.
Fixya is always less expensive than a service call.