This \(r\) is the APR. Through all of this blog unless otherwise stated, use these equations with \(r\) = APR.
Defining APY on an investment
APY is a marketing term designed to inflate numbers on investment products. Its usage is sometimes justified by the general public's ignorance of calculus. To that end, it is defined as "The total return on an investment in 1 year."
APY is therefore bounded between two values depending on the value of \(n\). At \(n\) = 1, APY = \(r\) but as \(n \rightarrow \infty\), APY \( \rightarrow e^r-1\). It is in the interest of investment managers therefore to report of APY rather than APR, to brag about large APY numbers without affecting investment performance.
$$
r \leq \text{APY} \leq e^r - 1
$$
In practice, the differences are quite small so they only become important when deciding between otherwise comparable investment products. For example, 12% APR becomes 12.75% APY with \(n \rightarrow \infty\). With \(n\) = 12, the APY becomes 12.68%.
[Caption] APY vs APR by number of maturation cycles per year (\(n\)). Dashed lines represent APY vs APR as \(n \rightarrow \infty\) (top) and at \(n\) = 0 (bottom). Drag the purple dot to change the number of maturation cycles. Double click the purple dot to set \(n\) = 12 (the most common value since most interest calculations involve monthly maturation giving 12 cycles per year). The difference between \(n\) = 100 and \(n \rightarrow \infty\) is negligible (the blue line completely obscures the dashed line).