We need to establish continuity at x=3.
So 2kx²-x=x³+cx so 18k-3=27+3c, 18k-3c=30, 6k-c=10, so c=6k-10
The gradients must also be the same at x=3, so
4kx-1=3x²+c at x=3, 12k-1=27+c, 12k-c=28, so c=12k-28.
Therefore 12k-28=6k-10, 6k=18, k=3 and c=8.
Now we have continuity and differentiability.