Welcome to the forum. First note that variable names are case-sensitive in mathematics, so k and K may very well denote different entities. In this case, since all other variables are lowercase, it would be reasonable to use k everywhere instead of K.

Your text probably considers that "stretching by k" by definition means moving a point (x, y) into (kx, y). For k > 1 this is indeed stretching; for k < 1 this is actually compressing. However, in both cases the term "stretching by k" is used. If this is so, then stretching a graph by k amounts to changing f(x - d) to f((x - d) / k). In your case, stretching by 1/2 (which is compressing around the y-axis) amounts to changing x to 2x.

Please recall the order of operations and use parentheses properly. is indeed different from .