Sometimes utility functions are wacky, like $U = T + \ln(R)$ or $U = \min(T, 2R)$. For those, you’ll use a slightly different recipe. With Cobb-Douglas functions (like $T^a R^b$), the demand is always: spend a fraction of income on each good. For perfect substitutes, you buy only the cheaper one—sorry, fancy ramen.
How to Find a Demand Function from a Utility Function - YouTube
For perfect complements (like peanut butter & jelly), you buy them in fixed ratios. The math gets a bit wild, but the idea stays the same: maximize joy, respect your wallet. You’re basically an economic ninja.