def METHOD_NAME():
    tape = Tape()
    set_working_tape(tape)
    mesh = UnitSquareMesh(10, 10)
    V = FunctionSpace(mesh, "CG", 1)
    bc = DirichletBC(V, Constant(1), "on_boundary")
    k = Constant(2.0, domain=mesh)
    x, y = SpatialCoordinate(mesh)
    expr = sin(k*x)
    f = project(expr, V)
    u = TrialFunction(V)
    v = TestFunction(V)
    u_ = Function(V)
    a = inner(grad(u), grad(v))*dx
    L = f*v*dx
    solve(a == L, u_, bc)
    J = assemble(u_**2*dx)
    Jhat = ReducedFunctional(J, Control(k))
    k.block_variable.tlm_value = Constant(1)
    tape.evaluate_tlm()
    assert(taylor_test(Jhat, Constant(k), Constant(1), dJdm=J.block_variable.tlm_value) > 1.9)