Another way to find the sum $S=1-\dfrac{3}{2}+\dfrac{5}{4}-\dfrac{7}{8}+\cdots+(-1)^{n-1}\cdot\dfrac{2n-1}{2^{n-1}}$ I want to know the sum
$$S=1-\dfrac{3}{2}+\dfrac{5}{4}-\dfrac{7}{8}+\cdots+(-1)^{n-1}\cdot\dfrac{2n-1}{2^{n-1}}.$$ This is my way.
First, we find the sum
$$1 + 3 x + 5x^2 + \cdots + (2n-1) \cdot x^{n-1}=\sum _{k=1}^n (2 k-1) x^{k-1}.$$
We have
$$\sum _{k=1}^n (2 k-1) x^{k-1} = 2\sum _{k=1}^n k\cdot x^{k-1}-\sum _{k=1}^n  x^{k-1}. $$
Note that
$$\sum _{k=1}^n k\cdot x^{k-1} = \left (\sum _{k=1}^n x^k\right)' = \left (\dfrac{x\left(x^n-1\right)}{x-1}\right)'=\dfrac{n x^{n+1}-(n+1)x^n+1}{(x-1)^2}.$$
Another way
$$\sum _{k=1}^n  x^{k-1} = \dfrac{x^n-1}{x-1}.$$
From the above results, we have
$$1 + 3 x + 5x^2 + \cdots + (2n-1) \cdot x^{n-1}= \dfrac{(2 n-1) x^{n+1}-(2 n+1)x^n+x+1}{(x-1)^2}.$$
With $x=-\dfrac{1}{2}$,we get
$$S=\dfrac{2^n + (-1)^{n+1} \cdot(6n+1)}{9 \cdot 2^{n-1}}.$$
How to find the result with another way?

I would have done it in a similar but different way. Consider the polynomial$$1-3x^2+5x^4-7x^6+\cdots+(-1)^{n-1}(2n-1)x^{2n-2}.$$If its sum is denoted by $f(x)$ and if$$F(x)=x-x^3+x^5-x^7+\cdots+(-1)^{n-1}x^{2n-1},$$then $F'=f$. On the other hand$$F(x)=x\left(1-x^2+x^4-x^6+\cdots+(-1)^{n-1}x^{2n-2}\right)=\frac{x-(-1)^nx^{2n}}{1+x^2}.$$Therefore,$$f(x)=\frac{-(-1)^n (2 n+1) x^{2 n}+(-1)^n (1-2 n) x^{2n+2}-x^2+1}{(1+x^2)^2}$$and, in particular, your sum is$$f\left(\sqrt{\frac12}\right)=\frac{1}{9} 2^{1-n}\bigl(2^n-6 (-1)^n   n-(-1)^n\bigr).$$
