In a kinematics question of linear motion I have been given a function between velocity$(v)$ and time$(t)$.
$v=(t-1)(t-2)$
and that for $t=0$, position of particle is $+4$.
Now I have to find its velocity at origin.
I integrated $v$ and got a cubic equation. Now I'm unable to solve. Is there any way to solve this problem?

You need to find for what $t$ the position is $0$.
integrating $v$ gives us position;
$s = \displaystyle\int(t-1)(t-2)\,dt = \int (t^2-3t+2)\,dt = \frac{t^3}3-\frac32t^2+2t+C$
given that $s(0) = 4$
$\implies 4 = C$
$\therefore s(t) = \displaystyle\frac{t^3}3-\frac32t^2+2t+4$
To find at what $t$ position is zero set $s(t) =0$
$s(t) =0 =\displaystyle\frac{t^3}3-\frac32t^2+2t+4$
The above is not easily solvable and you can find the solution using numerical methods . The only real solution is $x \approx -1.03$
So the velocity at origin is given by;
$v(-1.03) = (-1.03-1)(-1.03-2)= 6.1509$