Solving the functional equation $ T (n) = 3 ~ T(\frac{n}{2}) + n^{2} $. I’m trying to solve the following recurrence relations for run-time $ T(n) $. Assuming $ T(n) $ is constant for $ n \leq 2 $, solve
$$
T(n) = 3 ~ T \! \left( \frac{n}{2} \right) + n^{2}.
$$
For real $n$ there are exact solutions $A|n|^b + cn^2$ where $A$ is a free parameter and $b,c$ are determined by the recurrence.  The recurrence for integer $n$ will approximate that after defining what $T(n/2)$ means.

The exponent $b$ is the same as the fractional dimension of the Sierpinski triangle which is made of $3$ copies of itself at $1/2$ the scale, a form of the same recurrence (without the $n^2$ term).
$\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$


  $\ds{\mrm{T}\pars{n} = 3\,\mrm{T}\pars{n \over 2} + n^{2}:\ ?\,,\qquad
\left.\vphantom{\large A}\mrm{T}\pars{n}\right\vert_{\ n\ \leq\ 2} = \mbox{'initial' constant}}$.


Lets $\ds{\,\mrm{T}\pars{n} \equiv \tilde{\mrm{T}}\pars{n}n^{2}\implies
\tilde{\mrm{T}}\pars{n} = {3 \over 4}\,\tilde{\mrm{T}}\pars{n \over 2} + 1
\implies\tilde{\mrm{T}}\pars{n} - 4 =
{3 \over 4}\bracks{\tilde{\mrm{T}}\pars{n \over 2} - 4}}$ which leads to:
\begin{align}
\tilde{\mrm{T}}\pars{n} - 4 &amp; =
{3 \over 4}\,{3 \over 4}\bracks{\tilde{\mrm{T}}\pars{n \over 2^{2}} - 4} =
{3 \over 4}\,{3 \over 4}\,{3 \over 4}
\bracks{\tilde{\mrm{T}}\pars{n \over 2^{3}} - 4} = \cdots =
\pars{3 \over 4}^{k}
\bracks{\tilde{\mrm{T}}\pars{n \over 2^{k}} - 4}
\end{align}
which is equivalente to
$$
\mrm{T}\pars{n} = 4n^{2} +
\pars{3 \over 4}^{k}n^{2}
\bracks{{\mrm{T}\pars{n/2^{k}} \over \pars{n/2^{k}}^{2}} - 4}
$$

$$\bbox[8px,#efe,border:0.1em groove navy]{%
\mrm{T}\pars{n} = 4n^{2} +
\pars{3 \over 4}^{k}
\bracks{2^{2k}\,\mrm{T}\pars{n \over 2^{k}} - 4n^{2}}}
$$


  The final solution is found with a value of $\ds{k}$ which satisfies
  $\ds{{n \over 2^{k}} \leq 2 \implies k \geq {\ln\pars{n} \over \ln\pars{2}} - 1}$


$$\bbox[8px,#efe,border:0.1em groove navy]{%
\mrm{T}\pars{n} = 4n^{2} +
\pars{3 \over 4}^{k_{c}}
\bracks{2^{2k_{c}}\,\mrm{T}\pars{n \over 2^{k_{c}}} - 4n^{2}}}\,,\qquad
\left\{\begin{array}{rcl}
\ds{k_{c}} &amp; \ds{\equiv} &amp;
\ds{\left\lceil{\ln\pars{n} \over \ln\pars{2}} - 1\right\rceil}
\\[2mm]
\ds{\mrm{T}\pars{n \over 2^{k_{c}}}} &amp; \ds{=} &amp; \mbox{'initial' constant}
\end{array}\right.
$$