Second order reaction half life equation? For the reaction: 
$$2A\to p$$
The rate, $v$ may be given as:
$$v=-\frac12\frac{d[A]}{dt}=k[A]^2$$
Correct?

Integrating this gives:
$$-\frac12\int_{[A]_0}^{[A]}\frac{d[A]}{[A]^2}=k\int_0^tdt$$
$$\frac1{2[A]}-\frac1{2[A]_0}=kt$$
Rearranging...
$$\frac1{[A]}=\frac1{[A]_0}+2kt$$
Now substituting $t=t_{1/2}$ and $[A]=\frac{[A]_0}2$...
$$\frac2{[A]_0}=\frac1{[A]_0}+2kt_{1/2}$$
Minus $1/[A]_0$ from each side...
$$\frac1{[A]_0}=2kt_{1/2}$$
This then gives:
$$t_{1/2}=\frac1{2k[A]_0}$$

However, I have seen in textbooks that this should be written:

$$t_{1/2}=\frac1{k[A]_0}$$

Have I gone wrong somewhere? If so where?

I need to know which equation is correct because when figuring out the rate constant, would the gradient be equal to $\frac{1}{2k}$ or $\frac{1}{k}$?
What you did isn't wrong, but instead of:

$$v=-\frac12\frac{d[A]}{dt}=k[A]^2$$

some write:

$$v=-\frac{d[A]}{dt}=k[A]^2$$

which is also true.

Twice a constant is still as constant (a different constant of course).

See http://www.chem.arizona.edu/~salzmanr/480a/480ants/int2ord/int2ord.html