I want to solve this:
$$T(n) = 2 T\left(\frac{n}{2}\right) + n - 1 $$
I try :
\begin{align*} n &= 2^m \\ T(2^m) &= 2T(2^{m-1}) + 2^m -1 \\ 2 ^ m &= B \\ T(B) &= 2T(B-1) + B -1 && (1) \\ r - 2 &= 0 \implies r = 2 \implies T (B) = C*2^B && (h) \end{align*}
particular : $$ T(B) = AB + D \quad \text{(A and D are const)} $$ 1:
\begin{align*} AB + DB &= 2(AB + DB) + B -1 \\ A &= -1 \text{ and } D = -1 \\ T(B) &= c \cdot 2^B -1 -B \end{align*} and I can't continue solving currectly please help me
As I said in my comment, you have an error fairly early on, so I am not going to address what all went wrong in your proof.
Here is how I would do it: Let $ k = \log_2 n $ and $ g(k) := 2^k $. Hence $$ T(g(k)) = 2T(g(k - 1)) + 2^k - 1 $$ Let $ f:= T \circ g $. Substituting this in: $$ f(k) = 2f(k - 1) + 2^k - 1 $$ Next, let, $ h(x) := 2^{-x}f(x) $. Hence, $$ h(k) = h(k-1) + 1 - 2^{-k} $$ From here, it is easy to determine a function for the case where the domain of $ h $ is the natural numbers: $$ h(k) = h(0) + \sum_{n = 1}^k 1 - 2^{-n} = h(0) + k + 1 - 2^{-k}$$ Because $ h(x) = 2^{-x} \left(T \circ g\right)(x) $, $ T(x) = 2^x h\left(g^{-1}(x)\right) = 2^{\log_2 x} \left(h(0) + \log_2 x + 1 - \frac{1}{x}\right)$, which reduces to $$ T(x) = Cx + x + x \cdot \log_2 x - 1 $$ where $ C = T(1) $.
The hard part is proving that this is the unique definition across the real numbers. While it is easy to verify that it works on such a domain, that doesn't necessarily imply uniquness.