“What part of your brain is responsible for logic or complex thinking?”
Short answer: all of it.
Longer answer: it’s a symphony.
First level answer: the cerebrum. The cerebellum is responsible for trained activities of the body, including speech, but it is directed by the cerebrum.
Of course, the cerebrum consists of two hemispheres. The hemispheres each have a different construction of the world, and it is the synthesis of their views that makes us human.
A quick summary of the hemispheres follows. Their full relation is much too complex to describe in a Quora answer. The right hemisphere, having access to the entire visual field, sees the larger picture and understands how the larger picture changes over time. You might say it understands the world from the top down. The left hemisphere, having access only to the right half of the foveal vision, sees the pieces of the world and how they are related. You might say it understands the world from the bottom up. No other animal that we know can hold both of those views and synthesize them.
The left hemisphere’s bottom-up view provides a symbolic understanding of the world. Its symbols are held at various levels of detail, and it understands how those levels relate to one another. So it sees a chair as a seat, four legs, and a back. It is also aware of variations of this description, but if you ask most people to draw a chair, that is what you will get. The left’s symbolic understanding includes words to denote most of the symbols, along with rules for using words to construct sentences and larger utterances. The left sees time as a set of symbolic relations (“before”, “during”, “depends on”, etc.).
The right hemisphere’s top-down view provides a holistic understanding of the world. It understands how all the pieces fit together, and how they work together as processes. It sees a chair as one or more images of chairs it has been exposed to, and it knows how chairs are used by people. If you ask some people to draw a chair, they will draw one of the many chairs they have seen, picking one to match the context of the question. The right side understands context and provides context to all our thoughts. The right side has words, and they are attached to experiences and processes. The right side senses and understands the flow of time and how context, experiences, and processes fit into the flow.
Now for an answer to the question.
The left hemisphere understands the symbology of logic and complex thinking. It knows all the parts (objects and rules) and can talk about them in the abstract. People with right hemisphere lesions can talk quite convincingly about abstract systems they have learned. Moreover, complex thoughts and processes are almost never understood in a vacuum; they are learned and shared and taught. The left hemisphere and its understanding are heavily involved in such discourse.
The right hemisphere understands the context of logic and complex thinking. It knows what a logical inference means in a particular context, and it understands how various contexts can change the meaning. It understands how complex thinking and processes vary in time. It understands the context of discourse involving complex thoughts and processes.
A discipline often considered a domain of logic and complex thoughts is mathematics. (I have a degree in math.) The left hemisphere understands the proper construction and manipulation of equations, but the right hemisphere knows what they mean. The left hemisphere can construct and understand the graph of a parabola, but the right hemisphere sees the parabola and intuits the sign of the derivative at each point. Going further into advanced analysis, the equations get more complicated and abstract, which the left hemisphere manages, but the meanings become ever more abstract, and the right hemisphere needs to follow those meanings or the equations are useless. As an extreme example, only the right hemisphere can understand and manipulate high dimensionality spaces, though the left hemisphere is needed to share that undertanding.
History also requires cooperation of both hemispheres. The left hemisphere can understand all the events and static relations of a time period, but it is the right hemisphere that sees the patterns and understand the flow. And so it is with every discipline.
The answer to the question depends on its context.