﻿from sympy import *

x=symbols('x')
expand((1/2*x+3)^3)